Is it possible for rsync
to rename its destination folder after successful run. So that I can always make sure the proper folder name always has a successful and complete backup?
Example:
rsync to folder /backup/incomplete-2017-02-26
and after it finished synching to rename it to /backup/2017-02-26
Update
I need this for either local folders or remote folders.
Just use the return value of
rsync
- it will return0
upon successful completion:The exit code is also available in the variable
$?
right after the command runs - beware, this will be overwritten by the next command.