Results 1 to 6 of 6
Hello all...
Here is my script I would like to run every day at 1615 (4:15pm)
rsync -av --exclude=Music --exclude=Virtual_Machines /home/<user> <user>@<server>:/home
I have saved it as home/<user>/scripts/desklapsync.sh with perms ...
- 03-20-2008 #1
Am I setting this up for a cron job correctly?
Hello all...
Here is my script I would like to run every day at 1615 (4:15pm)
I have saved it as home/<user>/scripts/desklapsync.sh with perms set to 644.rsync -av --exclude=Music --exclude=Virtual_Machines /home/<user> <user>@<server>:/home
So I would like to have it run as a cron job.
Here is my crontab...
Is this all correct?15 16 * * * home/<user>/scripts/desklapsync.sh
And if so, how can I tell if the job ran?
Thanks.
- 03-20-2008 #2
I'd add a couple things to the script (sh-bang line, FQ binary name, and exit).
Replace '/usr/local/bin' with the correct FQ path to rsync.Code:#!/bin/bash /usr/local/bin/rsync -av --exclude=Music --exclude=Virtual_Machines /home/<user> <user>@<server>:/home exit 0
I am presuming you've already tested that this works properly outside of cron...
Check the cron logs in /var/log. Also, you're putting rsync in verbose mode, so you're going to be getting system email to the account that is running the rsync. (By default stdout/stderr chatter from cron will go to the user's mailbox.) So check with mail.
Originally Posted by AboveNBeyond
- 03-20-2008 #3
- 03-22-2008 #4
Thanks Anomie... just a couple more questions...
1) Does my cron tab entry look correct?
2) How can I tell if the cron job ran successfully?
It sends an email, no?
- 03-22-2008 #5
- 03-23-2008 #6Linux Engineer
- Join Date
- Feb 2005
- Posts
- 1,044
Also, if you're expecting cron to execute your script you should really make it executable (755, subject to which user is running the cron job).


Reply With Quote