Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Cron emails some errors, not others
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
grant123
l33t
l33t


Joined: 23 Mar 2005
Posts: 643

PostPosted: Wed Jul 17, 2013 6:14 pm    Post subject: Cron emails some errors, not others Reply with quote

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
View user's profile Send private message
desultory
Administrator
Administrator


Joined: 04 Nov 2005
Posts: 7820

PostPosted: Fri Jul 19, 2013 3:35 am    Post subject: Reply with quote

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
View user's profile Send private message
grant123
l33t
l33t


Joined: 23 Mar 2005
Posts: 643

PostPosted: Fri Jul 19, 2013 5:10 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum