[PATCH] Ensure that rsync backups are only running one at a time

Mike McGrath mmcgrath at redhat.com
Wed Mar 24 16:26:07 UTC 2010


On Wed, 24 Mar 2010, Jesse Keating wrote:

> On Wed, 2010-03-24 at 10:54 -0500, Mike McGrath wrote:
> >  # Sync out
> >  for host in db01 db02 db03; do
> > +    # Sleep if any other rsyncs are already
> > +    while ssh $host "pgrep rsync" | grep -q [0-9]; do sleep 10; done
>
> Seems like a pretty wide net, what if somebody is rsyncing something
> else to/from that box?  Would it not be better to make use of a
> lockfile?
>

I'd think in that scenario we'd want to wait until they're done too.

	-Mike


More information about the infrastructure mailing list