Backup with rsync and crontab
Hi,
I have written a simple backup script which runs fine through the console (with su), but when I try to set it up as a cron job, it doesnt run. the backup script is as follows Code:
rsync -a --delete /home/gavinjb/ /mnt/IntBackup/Gavin/ Code:
20 * * * * root /home/gavinjb/Documents/scripts/backup.sh the cron job is created under su and not standard user. Thanks, Gavin, |
You probably need to add the complete path to rsync in the script. Since it may not be in the path when cron runs.
I'm assuming you have #!/bin/sh at the top and it is executable. |
You can also check the system mail, which is the place where crontab jobs send their standard input and error by default.
|
Hi,
Can you tell me how I access the system mail, I am fairly new to Linux and havent got as far as looking at system mail yet :). Thanks, |
You have to be logged in as the user that launched the crontab, and type 'mail' on the command line. You get a list of the messages you have in your mailbox (if any). Type "?" to retrieve a list of commands, type the number of the message you want to read, type "x" to exit. And of course read the manual page of mail to learn more! ;-)
|
All times are GMT -5. The time now is 11:02 PM. |