I have a cronjob that runs hourly, and is totally silent unless something goes wrong. Well ... almost ...

A part of the job is

rsync --del -Cacqrz public/. user@host.example.com:/target/path

This always prints "logged in". How can I make it stop? (Short of 'grep -v' ;-)

I don't get the "logged in" message if I do things like

ssh user@host.example.com ls

The transport is, of course, ssh (using keys).

Source host is either OSX or Ubuntu (tried both, same behavior). Target host is Linux of some flavor.

  • You can change the default verbosity of ssh in ~/.ssh/config or globally in ssh_config (location varies with distro). – Aaron May 1 '17 at 20:54

quiet option should do that:

-q, --quiet suppress non-error messages

  • 1
    I'm using the rsync "-q", which successfully stifles a lot of blather, but it's not stopping this one message (which does not look like a problem to me). I think the un-stifled message comes from ssh/scp, but I don't have direct access to that command line. So I don't see how your suggestion helps. – jackr May 1 '17 at 23:34
  • You can modify ssh options: rsync -e 'ssh -q' will stop ssh from outputting the ssh banner, for example. – Angelo Aug 20 '20 at 23:51

You can redirect stdout and stderr to /dev/null with something like:

<command> 2>&1 >/dev/null
  • ...and then check the return code from rsync ($?) -- if it's non-zero something went wrong and you have to handle that error gracefully. – voretaq7 Oct 18 '13 at 21:22
  • 1
    @voretaq7 Meh, it's friday. I'm drinking beer. Can't think about such things. :) – EEAA Oct 18 '13 at 21:24
  • 3
    Error Checking? AIN'T NOBODY GOT TIME FOR THAT! – voretaq7 Oct 18 '13 at 21:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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