Lex-2008/backup3

Add to backup only after rsync finished successfully

Lex-2008 opened this issue · 0 comments

Currently, we run find and add to backup whatever state "current" directory is after rsync run finished. No matter if it was successful or partial. It can lead to an issue like this:

if you have edited few files which depend on each other (for example shell scripts which call each other), interrupted due to timeout rsync might have copied only one of them. In this case, if your later restore backup at this time - you end up with a broken system (old version of one file, new version of another).

Solution is to rsync to a temporary dir and ... that one to "current" one. Note that inodes, also of directories, must not change!