It could be a timing issue that means there's no route or server
available at that time. Given the length of the command line, I'd be
tempted to put it in a shell script with a connection checker:
#!/bin/bash
# Prod the rsync server...
check=$(echo -e "\n" |netcat sunsite.uio.no 873);
if [ "$check" != "@RSYNCD: 26" ]; then {
echo "Unable to connect to rsync server. Dumping traceroute:"
traceroute -n sunsite.uio.no
# or whatever other tests you want to run.
} else {
# rsync command...
} fi
I use something like this before any unattended rsyncs.
Adding a bit more -vvvvvvvv might give you some more info, too :)
Mark Watts wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
>
> I've got an rsync command...
>
> rsync -av --stats --progress --partial --delete-after --bwlimit=2000
> rsync://sunsite.uio.no/Mandrakelinux /export/ftp/mandrakelinux
>
> This works just fine when runfrom the command line (as user
'mwatts').
>
> I've put it in the 'mwatts' users' crontab:
>
> MAILTO="m.watts@eris.qinetiq.com"
> 0 3 * * * rsync -av --stats --progress --partial --delete-after
--bwlimit=2000
> rsync://sunsite.uio.no/Mandrakelinux /export/ftp/mandrakelinux
>
> However, Every day I get the following email from cron:
>
> rsync: failed to connect to sunsite.uio.no: Connection timed out
> rsync error: error in socket IO (code 10) at clientserver.c(88)
>
>
> Why would I be getting this if it works on the command line?
>
> Mark.
>
> - --
> Mark Watts
> Senior Systems Engineer
> QinetiQ Trusted Information Management
> Trusted Solutions and Services group
> GPG Public Key ID: 455420ED
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.2.4 (GNU/Linux)
>
> iD8DBQFA7lFtBn4EFUVUIO0RAvWEAJ9FemOwR5PDBK67bGmRwPErMTzUfgCg997T
> B2PrqIKIOhSv/eQWNidrSlc> =bgFJ
> -----END PGP SIGNATURE-----