10

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.

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

2 Answers2

22

quiet option should do that:

-q, --quiet suppress non-error messages

Thomas Decaux
  • 1,289
  • 12
  • 13
  • 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 01 '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
8

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

<command> 2>&1 >/dev/null
EEAA
  • 109,363
  • 18
  • 175
  • 245