View previous topic :: View next topic |
Author |
Message |
grant123 Veteran
Joined: 23 Mar 2005 Posts: 1080
|
Posted: Wed Jul 17, 2013 6:14 pm Post subject: Cron emails some errors, not others |
|
|
My crontab runs the following:
/etc/cron.d/update.sh > /dev/null
/etc/cron.d/backup.sh > /dev/null
I receive emailed errors from update.sh, but not backup.sh. If I run '/etc/cron.d/backup.sh > /dev/null' manually, errors from the rsync command do appear on the command line. I can see in the logs that backup.sh is executing via the crontab. How is this possible?
backup.sh:
#!/bin/bash
rsync -az -e 'ssh -i /root/.ssh/id_rsa' --delete backup@1.2.3.4: /backup/rsync
rdiff-backup /backup/rsync /backup/rdiff-backup
rdiff-backup --force --remove-older-than 1Y /backup/rdiff-backup |
|
Back to top |
|
|
desultory Bodhisattva
Joined: 04 Nov 2005 Posts: 9410
|
Posted: Fri Jul 19, 2013 3:35 am Post subject: |
|
|
As a general rule, if you are only getting error messages, you are probably only reading stderr. You could try adding redirects accordingly if you really want to ignore the errors, or you could possibly modify the script to deal with them properly.
Moved from Installing Gentoo to Other Things Gentoo, given that this is an issue with an installed and running system. |
|
Back to top |
|
|
grant123 Veteran
Joined: 23 Mar 2005 Posts: 1080
|
Posted: Fri Jul 19, 2013 5:10 am Post subject: |
|
|
The problem is that I'm not emailed stderr for backup.sh even though stderr does appear on the command line. I am emailed stderr for update.sh. How is that possible? |
|
Back to top |
|
|
|