Having problems with cron
I am trying to use cron to run a daily backup script, the script checks to make sure that the person running it is root before it executes anything.
if [ "$USER" != "root" ]; then
echo "You must be root to run backup."
exit 1
fi
so far I have tried using root's crontab file with a like like this:
1 0 * * * /usr/local/sbin/backup
/usr/local/sbin/backup being the script that I want to run, I have also tried putting it into the crontab file with a line like this:
1 0 * * * root /usr/local/sbin/backup
everytime it comes back and tells me, "You must be root to run backup."
anyone have any ideas?
|