On Wed, 5 Aug 2009, Nick Olsen wrote: > Ok I think I got it, just one more thing. If I make the lock file myself > with the date >> /tmp/update-centos.lock file it works and doesn't let > another one spawn. However. If its not there its not creating it. Do I > have the else part in the right spot? > > #!/bin/bash > > if [ -f /tmp/update-centos.lock ] > # It does exist. > # Exit here so we don't screw up a run in-progress > then echo "Lock file exists" && exit 1 > # No, it doesn't exist. > # Create the lock file so another run won't start. > else date >> /tmp/update-centos.lock > fi > > ### Now we can do the actual rsync. At this point, we know that only one > ### copy of the script is running. > > ### Big long rsync command ### > echo "Starting centos rsync" > screen -A -m -d -S centos rsync -vaH --numeric-ids --delete > --delete-after --delay-updates --progress > rsync://linux.mirrors.es.net/centos/ /home/www/centos > DATE=`date` > echo "$DATE with mirror linux.mirrors.es.net" > > /home/www/txt/centostime.txt > > # Now we're done. Remove the lock file. > /bin/rm -rf /tmp/update-centos.lock Hmm. What happens if you remove screen from the picture (that is, have the script run the rsync directly)? DR -- David Richardson <david.richardson at utah.edu> "There are two kinds of statistics: the kind you look up and the kind you make up." -- Archie Goodwin, Death of a Doxy