On Sat, Apr 04, 2009 at 04:37:19PM -0400, Phil Schaffner wrote: > Created a new HowTo on running your own local mirror: > http://wiki.centos.org/HowTos/CreateLocalMirror > > Comments and (constructive :-) criticism are invited. > nice writeup, just my 2 cents: consider adding a lockfile if the script is used automatically in a crontab ;)
...
# try to create the lock and check the outcome
LOCKFILE=/var/run/rsync-home.lock
lockfile -r 0 ${LOCKFILE} 1>/dev/null 2>&1
status=$?
if [ ${status} -ne 0 ] ;then
echo "Another instance already running. Aborting."
exit 1
fi
trap "rm ${LOCKFILE}" EXIT
# body of the script here
...
other examples are also available in the centos-mirror mailing list archives.
Cheers,
Tru
--
Tru Huynh (mirrors, CentOS-3 i386/x86_64 Package Maintenance)
http://pgp.mit.edu:11371/pks/lookup?op=get&search=0xBEFA581B
pgpPk7sW2wwKq.pgp
Description: PGP signature
_______________________________________________ CentOS-docs mailing list [email protected] http://lists.centos.org/mailman/listinfo/centos-docs
