I find that rsync is an excellent tool for backing up my large partitions, often over slower links on the Internet. I run a cron job every night to update backup mirrors. But occasionally I make large changes to the source disk, and the rsync update takes more thanb 24 ours to complete. Then I can have two or more rsyncs working over the same source and destination directories. What I really want is to tell rsync to desist the mirroring after a certain amount of time. It's ok with me if it takes a few nights to bring the mirrors back into alignment. I can and have done this easily with a shell script that kills the rsync after a given amount of time. But this seems like an easy and useful feature to add to the program itself. Bill Cheswick ches@cheswick.com
ches wrote...> What I really want is to tell rsync to desist the mirroring after a > certain amount of time. It's ok with me if it takes a few nights to > bring the mirrors back into alignment. > > I can and have done this easily with a shell script that kills the rsync after > a given amount of time. But this seems like an easy and useful feature to > add to the program itself.An alternate solution to your problem was locking - rsync refuses to start if a given file exists and is locked by another process. Again, this could be done in a shell script around rsync. Christoph
On Wed, Jun 15, 2005 at 10:42:43AM -0400, ches wrote:> What I really want is to tell rsync to desist the mirroring after a > certain amount of time.See the file patches/time-limit.diff in the rsync distribution for an implementation of this idea which you can choose to patch into your local rsync, if you like (it implements both --time-limit=MINS and --stop-at=WHEN, as described in the update to the manpage). ..wayne..
On Wed, 15 Jun 2005, ches wrote:> I find that rsync is an excellent tool for backing up my large > partitions, often over slower links on the Internet. I run a cron job > every night to update backup mirrors. > > But occasionally I make large changes to the source disk, and the rsync > update takes more thanb 24 ours to complete. Then I can have two or > more rsyncs working over the same source and destination directories. > > What I really want is to tell rsync to desist the mirroring after a > certain amount of time. It's ok with me if it takes a few nights to > bring the mirrors back into alignment.That may be out of scope for rsync, but that's just me. I solved that problem by obtaining an flock() on a file in /var/lock. If a process starts up and can't attain the lock, it quietly dies (or does whatever I want it to do). Some people have tried goofy stuff like creating a lockfile and then checking for its existance. Aside from race conditions, if your process dies prematurely, it never gets deleted. I managed to write a perl library to manage my flock'ing. I can post it if anyone is interested. ..Chuck.. -- http://www.quantumlinux.com Quantum Linux Laboratories, LLC. ACCELERATING Business with Open Technology "The measure of the restoration lies in the extent to which we apply social values more noble than mere monetary profit." - FDR