crontab -e not running backup tasks.
-
I am trying to setup a task to backup \images\ to a usb drive but i cant get it to work.
I am using a program called grysnc and i have setup a task called images to do the backing up. it works grsync program.
i have setup a crontab as follows but using the command crontab -e i am using Unbuntu 14.04
00 02 * * 0-6 grsync -e images
that doesnt workI tried adding in some logging, bu t that doesnt work either.
00 02 * * 0-6 grsync -e images >> /home/myusername/logs/backup.log 2>&1Thanks and Happy christmas all.
-
your crontab should be:
00 02 * * * grsync -e /images >>/home/myusername/logs/backup.log 2>&1 -
Also, 0-6 on the DOW is the same as Everyday so you can literally just run
*for that field.0 is the same as 00 and 02 is the same as 2 so you can literally use:
0 2 * * *for the crontab itself. -
Thanks tom. made the suggested changes and ill see what happens tonight.
-
Your backup task is named images?
What’s the actual backup task look like?
-
@Tom-Elliott rsync -r -n -p -o -g -v --progress --delete --ignore-existing -i -s /images/ /media/myusername/5E8D585C1892608A/images
-
You have to path to the executable or include PATH in the crontab itself.
so if you ran
command -v grsyncit would give you the full path, you’d use this full path instead of just grsync. Or you could just stick the path at the top of the crontab file.echo $PATHand then take the output and put it into line 1 of the crontab as a variable likePATH="put the path output here"Read through this, they may make better sense than me. Plus I’m tired. http://stackoverflow.com/questions/2388087/how-to-get-cron-to-call-in-the-correct-paths