On Wednesday 30 Jan 2002 16:58, Robert Fox wrote:
> Anyone know of a way with Rsync to repeatedly check the server until it
> gets through? Is there a way to write a script which constantly checks
> the Rsync server until it gets a connection?
>
> This is VERY annoying - max connections for 3 days now!
>
> Thx,
> R.Fox
My rsync script is called rsync-cooker. I wake it up every 10 minutes
with a cron job that runs this...
#!/bin/sh
#------------------------------------------------------------------------------
# Description : Run from crontab to wake-up rsync
# File : rsync-refresh
# Directory : /usr/local/bin
# Author : Peter Ruskin
# Created On : Sunday 29 July 2001 13:43
#------------------------------------------------------------------------------
ISTATUS=`netstat -i | grep ppp0`
COOKERUP=`ps --no-heading -C rsync-cooker`
RSYNCUP=`ps --no-heading -C rsync`
if [ "$ISTATUS" == "" ] ; then # ppp down
sudo killall rsync-norway.pl rsync-sweden.pl rsync-cooker wvdial pppd
sleep 1s
/usr/local/bin/rsync-cooker &
exit 0
fi
if [ "$RSYNCUP" != "" ] && [ "$COOKERUP" != "" ]; then
# rsync and rsync-cooker are up
exit 0 # so leave them alone.
fi
if [ "$RSYNCUP" == "" ] ; then # rsync down
sudo killall rsync-norway.pl rsync-sweden.pl rsync-cooker
sleep 1s
/usr/local/bin/rsync-cooker &
fi
# ends here
--
Peter Ruskin, Wrexham, Wales. AMD Athlon XP 1600+, 512MB RAM.
Registered Linux User 219434. Mandrake Linux release 8.1 (Vitamin)
Kernel 2.4.8-34.1mdk-win4lin, XFree86 4.1.0, patch level 21mdk.
KDE: 2.2.2. Qt: 2.3.2. Up 6 hours 11 minutes.