Am 2009-12-23 22:06, schrieb Alex Samad:
On Tue, Dec 22, 2009 at 11:13:44AM +0100, Jakob Unterwurzacher wrote:
Alex Samad schrieb:
Hi

Is there a tool to lock the db such that rdif-backup will not use the
destination - i know rdif-backup does it.


I want to lock the db and then rsync the destination offsite and then
unlock the db.

With "db" you mean the rdiff-backup destination directory?

yes, I would like to lock the rdiff-backup destination such that
rdiff-backup will not use it until after the rsync offsite has finished.

I guess you will have to use a wrapper script for your rsync job and your rdiff-backup job that does the locking (and obeys the lock).

If you start both jobs at the same machine, it's easy:
Put this at the start of each script - it will then exit when another instance is running.

#####

#!/bin/bash

exec 200> /tmp/lockfileXYZ
flock -n 200 || echo 'Could not get lock!' && exit 1

#####


Jakob


_______________________________________________
rdiff-backup-users mailing list at rdiff-backup-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/rdiff-backup-users
Wiki URL: http://rdiff-backup.solutionsfirst.com.au/index.php/RdiffBackupWiki

Reply via email to