rdiff-backup-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[rdiff-backup-users] Best method for testing if another rdiff-backup ses


From: Jason L. Buberel
Subject: [rdiff-backup-users] Best method for testing if another rdiff-backup session in progress?
Date: Wed, 21 Nov 2007 17:15:03 -0800
User-agent: Thunderbird 2.0.0.6 (X11/20071022)

On my backup server I use rdiff-backup to remotely backup several rather large postgres database installations (using the postgres hot-backup capability). Under certain circumstances, these backups can take a very long time to complete.

The execution of these backups is scheduled via cron.

And when they take a very, very long time they can start to overlap. When this happens, I get an error message from rdiff-backup:

Fatal Error: It appears that a previous rdiff-backup session with process
id 21022 is still running.  If two different rdiff-backup processes write
the same repository simultaneously, data corruption will probably
result.  To proceed with regress anyway, rerun rdiff-backup with the
--force option.
Fatal Error: Lost connection to the remote system

I would like to write a small script called 'exit-if-already-running.sh' that takes the name of an rdiff-backup directory (the directory containing the directory named 'rdiff-backup'), and exits with return code 1 if a back is already in progress. That would allow me to use it as such:

10 5 * * * root /usr/local/bin/exit-if-already-running.sh /backup/srv1 && /usr/bin/rdiff-backup srv1::/remote-dir /backup/srv1

What is the most reliable method to determine if rdiff-backup is already running on the destination directory?

Thanks,
Jason

reply via email to

[Prev in Thread] Current Thread [Next in Thread]