Problem to run script auto from crontab.

Full path? I think I have full path?

I can see this in the log:
Code:
May 13 02:00:00 dynamitt /usr/sbin/cron[1437]: (root) CMD (/root/scripts/rsync.sh)
 
@ondra_knezour meant using full paths to commands inside the script. So instead of using find and assuming the PATH is correct you should use /usr/bin/find (it's just an example but you get the idea).

Keep in mind that scripts run from cron(8) have a very limited PATH.
 
Last edited by a moderator:
I would just add a MAILTO line above the job you are running to get the full output emailed to you. For example like the following. Then if there is a problem with it running you can get an email with the details:

Code:
MAILTO="your@email.com"

0 2 * * * /root/scripts/rsync.sh
 
I got it now, you're talking about the rsync full path. So cron is reading the line another way than a command in the shell. I will edit the script and report back :)
 
System's crontab is best left alone. If you need to run a job as root, use root's own crontab ( crontab -e as the root user).
 
Back
Top