[StAndrews and Fife LUG] Rsync a windows machine using cron = not working

David Tillotson linux at acmelabs.demon.co.uk
Mon Mar 1 13:54:46 GMT 2004


Not sure if the web-mail message got through, so re-posting!

In message <1076599195.18920.18.camel at localhost>, Sharpnet Internet 
Solutions <info at sharpnet.co.uk> writes
>I have a networked Mandrake 9.2 and Windows Me system. I have setup the
>following rsync command to backup the my documents content to the linux
>Mandrake every night with the following command stored in a file in the
>cron.daily dir:
>
>#!/bin/sh
>/usr/bin/rsync -rvz /mnt/mydocuments/ /home/archiver/mydocuments/ >>
>/var/log/rsync.log
>
>The problem I have is that it doesn't work, however when I run it
>manually (as root) it works?!
>
>I can't understand why the cron cannot do something that can be done
>manually?

Cron often doesn't create a usable set of std[in|out|err] by default, so 
there are quite a few things that cron cannot do properly without some 
tweaking!

 From the Samba FAQ:
"On some systems (notably SunOS4) cron supplies what looks like a
socket to rsync, so rsync thinks that stdin is a socket. This means
that if you start rsync with the --daemon switch from a cron job you
end up rsync thiking it has been started from inetd. The fix is simple
- just redirect stdin from /dev/null in your cron job."

Looks like adding "< /dev/null" should fix the problem.
-- 
David Tillotson



More information about the StAndrews mailing list