-
-
Notifications
You must be signed in to change notification settings - Fork 452
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Temporary backup name #189
base: master
Are you sure you want to change the base?
Conversation
I currently have some backups which are empty. Reason to find. If the backup name would be temporarely, I would have recognized the problem easier. |
@@ -613,8 +610,9 @@ while : ; do | |||
# Add symlink to last backup | |||
# ----------------------------------------------------------------------------- | |||
|
|||
fn_run_cmd "mv -- '$DEST' '$DEST_DONE'" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this use of mv
can be dangerous on some systems (like on tape backups; yes these are really still used in the wild as they are very cheap and long lasting)
it might be safer (as these are backups after all) to use a conflict check or -f
(force) flag to ensure backups make it when they have to overwrite partial or corrupt copies from previous runs.
also have you tested what happened with symlink conflicts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just used the same arguments for mv
it was used before (when continuing an aborted backup) (L485).
I see that mv -T
(or with long option mv --no-target-directory
) is safer than plain mv
. With -f
, it only overwrites empty directories, but does never move the directory to somewhere unexpected. Or what symlink conflict do you mean?
The porpose of this mv
is to mark the backup as completed. It should not overwrite any data (except in very strange or constructed cases).
I do not know enough about tape backups. Can they be used with current version? How does rsync decide if a hardlink should be created without rewinding? By caching data?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any reply @reactive-firewall ?
fi | ||
# update PID to current process to avoid multiple concurrent resumes | ||
fn_run_cmd "echo $MYPID > $INPROGRESS_FILE" | ||
fn_run_cmd "mv -- $PREVIOUS_DEST_RUNNING $DEST" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This mv
moves the incomplete backup to the new name, to resume. It is the same as before except of the temporary name.
advantages of temporary backup name:
=> no danger to try to resume a completed backup
=> lock can be set early without problems
setting the lock early prevents concurrent backups more reliable