Jakob Unterwurzacher wrote:
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

#####
Nice tip! An alternative which doesn't require flock or a temporary lock file is (again for a bash script):

######
#!/bin/bash

[ -n "`ps h -C rdiff-backup`" ] && echo "`basename $0` aborting - rdiff-backup is running" && exit 1

######

Dominic


_______________________________________________
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