I have other cron jobs running properly. this is my root user crontab
Code:
0 1 * * * /usr/bin/emerge sync
0 2 * * * /usr/sbin/fixpackages > /dev/null 2>&1
0 3 * * * /usr/bin/updatedb
1 * * * * /usr/bin/ntpdate -b molecule.ecn.purdue.edu > /dev/null 2>&1
0 2 * * 1,3,5 /etc/backup/backup.sh
most of these will email me via 2>&1
snipit
Code:
#Snip-Snap Backups
rm -rf /root/backups/mysql/snip-xml-*
rm -rf /root/backups/web-root/snip-htdocs-*
cd /var/www/localhost/htdocs
tar -zcPpf /root/backups/web-root/snip-htdocs-`date +%m%d%y`-tar.gz _snipsnap > snip-backup.log 2>&1 > snip-backup.log
[ -s snip-backup.log ] && cat snip-backup.log | mail -s 'snip-backup.log' root
rm snip-backup.log
$MYDUMPX snipsnap > /root/backups/mysql/snip-xml-`date +%m%d%y`.sql
The only thing I dont like is that I only have mail notification on certine parts, I would like to log the hole script and have that sent out via e-mail also.
can I add this to the crontab to log
Code:
0 2 * * 1,3,5 /etc/backup/backup.sh > host-backup.log 2>&1 > host-backup.log; cat host-backup.log | mail -s 'host-backup output' root
This is less important than getting it to work in the crontab of course
but it would help me see all the output.
also I can run these scripts by manually with no errors.