[CentOS-mirror] cron lock file

Mihai Maties mihai at xcyb.org
Tue Sep 13 08:35:53 UTC 2005

On Tuesday 13 September 2005 12:30, Mirror-Admin intergenia AG wrote:
> Hi,
> easiest way to prevent doubles is checking the process list. E.G. create a
> bash-script for your mirroring, that checks if there is already a
> connection to msync.centos.org::CentOS
> ---- SNIP ----
> #!/bin/bash
> if [ "$(ps auxw|grep msync.centos.org::CentOS|grep -v grep" != "" ];then

A better condition would be:

pgrep -f "rsync -options msync.centos.org ..." >/dev/null
if [ $? -eq 1 ]; then
     echo "You should start the mirror, no sync in progress"
     echo "Another sync is in progress"

...but this is begining to be a shell programming issue more than a 
mirror-setup thingie.


This message was scanned for spam and viruses by BitDefender.
For more information please visit http://www.bitdefender.com/

More information about the CentOS-mirror mailing list