Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

When I rsync or scp from a particular server I get a rather long message telling me the rules of the server. However when I setup regular pulls, I'd like to be able to suppress those messages in my logs. Looking through the man page suggest that -q should work, but that only quiets messages from scp itself. How can I do this?

share|improve this question
add comment

3 Answers

up vote 1 down vote accepted

For rsync, it has a --no-motd you can use to suppress the motd for your script and only see the output of what rsync is transferring. It looks like it was added in rsync 3.x since I don't see that option in 2.x.

The man page lists a caveat about not using it when trying to get a listing of modules you can rsync:

--no-motd

This option affects the information that is output by the client at the start of a daemon transfer. This suppresses the message-of-the-day (MOTD) text, but it also affects the list of modules that the daemon sends in response to the "rsync host::" request (due to a limitation in the rsync protocol), so omit this option if you want to request the list of modules from the daemon.

For scp, trying touching the file ~/.hushlogin. When I scp files, I don't see the motd though but your set up might be different. The man page for login has more info:

If the file .hushlogin exists, then a "quiet" login is performed (this disables the checking of mail and the printing of the last login time and message of the day). Otherwise, if /var/log/lastlog exists, the last login time is printed (and the current login is recorded).

share|improve this answer
    
rsync --no-motd does not work for me. The SSH MOTD is still being shown. –  ntrrgc Sep 10 '13 at 16:55
add comment

if your version of rsync doesn't support the --no-motd option puting "LogLevel quiet" in ~/.ssh/config will do the trick.

share|improve this answer
add comment

You can probably suppress the motd by redirecting STDERR to /dev/null, but that way you will miss all other error messages too.

scp src dst 2> /dev/null
share|improve this answer
    
This is not an option, all output is being directed to a log file that needs review later - errors are important! –  Hooked Dec 27 '12 at 22:21
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.