[Comm] Re: rsync и синхронизация репозитария

Andriy Dobrovol's'kii =?iso-8859-1?q?dobr_=CE=C1_iop=2Ekiev=2Eua?=
Чт Апр 21 14:05:56 MSD 2005


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Michael Shigorin wrote:
| On Wed, Apr 20, 2005 at 04:57:05PM +0300, Andriy Dobrovol's'kii wrote:
|
|>RSYNCARGS="-avut --partial --timeout=$TMOUT1 --delete"
|
|
| Где TMOUT1=500?  Тогда attached. :)
|
|
|
|
- 
------------------------------------------------------------------------
|
| #!/bin/sh
| RSYNC_RSH=rsh
| MAXATTEMPTS=5
| TMOUT1=500
| TMOUT2=15
| SRCROOT=rsync://rsync.altlinux.ru/ALTLinux	# 2003-04-15
| #SRCROOT=rsync://ibiblio.org/Linux/distributions/altlinux	# 2002-12-07
| #SRCROOT=rsync://ftp.leo.org/ALTLinux	# 2002-12-09
| DESTROOT=~ftp/pub/Linux/ALT
| #LIST="updates Sisyphus Mozilla OpenOffice Daedalus"
| #LIST="updates Sisyphus Mozilla Daedalus people/shrek"
| LIST="updates Sisyphus backports Mozilla Daedalus"
| #LIST="updates"
| RSYNC=/usr/bin/rsync
| RSYNCARGS="-rltgoDuz --partial --timeout=$TMOUT1 --delete
- --delete-after --exclude='*/2.0/*"
| #RSYNCARGS="-rltgoDuz --partial --timeout=$TMOUT1 --delete "
| RSHOME=~/rsync
| MAINTAINER="root+lazy на localhost"
|
| for mirror in $LIST; do
| 	OK=
| 	attempt=1
| 	LOG=$RSHOME/rsync-$mirror.log
| 	LOCK=$RSHOME/lock.$mirror
| 	FLAG=$DESTROOT/$mirror/__SYNCING__
| 	date >> $LOG
| 	[ -f $LOCK ] && {
| 		ps auxww | grep rsync | mail -s "OSDN: $mirror: lockfile exists"
$MAINTAINER
| 		echo "Lockfile for $mirror exists, quitting" >> $LOG
| 		continue
| 	}
| 	trap "rm -f $LOCK; exit 1" INT
| 	touch $LOCK $FLAG
| 	while [ -z "$OK" -a $attempt -lt $MAXATTEMPTS ]; do
| 		$RSYNC $RSYNCARGS $* $SRCROOT/$mirror/ $DESTROOT/$mirror \
| 			>> $LOG 2>&1 && OK=1
| 		sleep $TMOUT2
| 		attempt=$(($attempt+1))
| 	done
| 	[ -z "$OK" ] && {
| 		tail $LOG | mail -s "OSDN: $mirror trouble" $MAINTAINER
| 	} || {
| 		rm -f $FLAG
| 	}
| 	rm -f $LOCK
| 	date >> $LOG
| done
|
| nice symlinks -dr $DESTROOT >/dev/null
|
Не, у меня он был тогда значительно больше... :)
А так, ты правильно определил первоисточник... :)
- --
Rgrds,
Andriy
*********************************************************************
email: dobr at iop dot kiev dot ua            Kyiv, Ukraine
Phone: (380-44)   525-7824            Department of Gas Electronics
Fax:   (380-44)   525-2329             Institute of Physics of NASU
*********************************************************************
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFCZ3sDYy1tb7+AynYRAt66AJ4+3RD2nNZ5zM9nRY2EgsRLGd98egCgp0/N
eMk+n5loHKdsNOsLxnnjsWM=
=8mEB
-----END PGP SIGNATURE-----



Подробная информация о списке рассылки community