crontab + rsync problem

Andrew Glen-Young aglenyoung at gmail.com
Wed Oct 10 17:01:42 UTC 2007


On 10/10/2007, Luca Ferrari <fluca1978 at infinito.it> wrote:
> Hi all,
> I've got a shell script that executes rsync to update two directories. If I
> launch the script from the command line it works, if I launch it from crontab
> I can see the script running, without errors, but it does no sync the
> directories. In particular, rsync says that the copy started and ended in 1
> second, without any error. My thought is that there could be a problem with
> ssh or the network connection, something that causes rsync to be stopped
> immediately, but I don't have any idea of what it can be.

Can you post the commands and output from the successful and
unsuccessful command? How about the crontab entry?

Things I would check:
  * Syntax of the crontab entry:
    min hour day_of_mon mon day_of_week username /path/to/command
  * Cron runs with a restricted shell environment (PATH particularly).
  * Ensure (at least at first) that your paths are absolute.
  * Run rsync with full verbosity: rsync -vvv (3 or more v's)

And then the obvious question (which has to be asked and is not meant
to be clever): Perhaps the directories are up to date?

- A.




More information about the ubuntu-users mailing list