cronning rsync

Jos Backus jos at catnook.com
Thu Jun 20 10:04:03 EST 2002


On Thu, Jun 20, 2002 at 03:03:53PM +0100, matthew.2.burgess at bt.com wrote:
> ps -ef | grep 'rsync' | grep -v 'grep rsync' | grep -v 'rsync.sh' >
> /dev/null
> 
> if [ $? -eq 1 ]; then #rsync isn't running - let's launch it now
>  rsync [opts] user at host::/module/* .
> else
>   echo "Rsync is still running...please wait and try again later"
> fi

Note that this approach inherently suffers from a race condition: what if
rsync was started right after running the ps? Adrian's setlock idea avoids
this cleanly.

-- 
Jos Backus                 _/  _/_/_/        Santa Clara, CA
                          _/  _/   _/
                         _/  _/_/_/             
                    _/  _/  _/    _/
jos at catnook.com     _/_/   _/_/_/            use Std::Disclaimer;




More information about the rsync mailing list