Is running rdiff-backup or rsnapshot save while source directory is written?

0

I'm wondering if it's safe to use rdiff-backup or rsnapshot on a source directory which is written to while backup is running. Will they backup a snapshot of source or will they eventually backup changes to a lately processed file after process was started?

An usage example: I'm starting one of the tools mentioned to do a backup. If I'm changing file A and file B while process is running, could it be that only changes to one of them is included in backup?

Or in other words: Do I have to run them against a lvm snapshot (or similar technique) to ensure that all files are from same point of time? How does lvm snapshot handle write locks?

I could not find any information about rsnapshot and rdiff-backup. If the answer to this question is correct, rsync is not safe.

jelhan

Posted 2016-03-20T22:07:43.853

Reputation: 77

Answers

1

No, it's not safe to use those tools while the directory is updating. They all traverse the directory and will copy the contents of the file at the point they happen to check it, and will not check again later (and, even if they did, there's still a race-condition there).

An LVM snapshot (or simply pausing the processes that touch those files) would be an appropriate solution.

An alternative solution would be to use lsyncd or SyncThing, or some other tool that continuously watches for changes.

ams

Posted 2016-03-20T22:07:43.853

Reputation: 951