Stop rsync from sending confirmation e-mails

Today I found out I have a 25GB /var/mail/root full of e-mails from rsync. Apparently it's sending myself (root@server) an e-mail with the file list every time I run an rsync, which happens to be once every few minutes.

This is a Debian server and I couldn't find any config files for rsync. So my questions are:

1- Where is the config file for rsync on Debian? 2- How do I disable those rsync e-mail notifications?

Thanks!


rsync does not send emails, so something else wrapped around rsync is doing it. I'm assuming this is a cronjob calling rsync. The cronjob that runs rsync generates output on stdout. By default, cron then mails that output to root.

So first, find the cronjob that is running rsync. Places to look:

/etc/crontab
/etc/cron.*/
run crontab -l as root
/var/spool/cron/*

Once you find the cronjob that calls rsync, try running it manually on the command line. You should find that it displays output that matches the emails you are receiving.

Next you need to redirect or suppress that output. In the cronjob, you can do something like this:

* * * * * /usr/bin/rsync blah &>/dev/null

to suppress all output. Alternately, change the rsync flags you are using to eliminate output, or redirect it to a logfile (but don't forget to then set up rotation!).

Another troubleshooting idea: include the headers from one of these emails in this question so we can examine them for clues.


If you're running rsync out of cron, then rsync isn't sending you email, cron is. Cron will email the output of cronjobs to (by default) the root user. You can:

  • Run rsync without the verbose flag, in which case it will no longer generate a file list.
  • Redirect stdout/stderr of your cron job (using '>' i/o redirection)

You need to add redirection from your script in cron to stop the email. Check your crontab (or the system crontab where the script runs) and add redirection like your_rsync_script.sh > /dev/null 2>&1.

You can also remove the "v" (verbosity) flag from the rsync command in order to quell the output from the cron job.