Anyone know how to do those "locks" that they mention for the cron job?
Sample simple rsync shell script with lock files:
#!/bin/bash
RSYNC="/usr/bin/rsync" # path to rsync FLAGS="-aqzH --delete" # flags to pass to rsync MIRROR="msync.centos.org::CentOS" # mirror url REPO="/var/ftp/pub/centos" # location to store files LOCKFILE="/var/lock/subsys/rsynccentos" # location of lock file
if [ -f $LOCKFILE ] # check to see if lock file exists then echo Lock file exists...Exiting... exit 0 else touch $LOCKFILE # create lock file fi echo Rsyncing... $RSYNC $FLAGS $MIRROR $REPO # issue rsync command rm -f $LOCKFILE # remove lockfile exit 0