Open protist opened 5 years ago
@protist There is a new forming maintaining team and we do review all issues. Is this problem still relevant for you, can you reproduce it with a newer or the latest release? Did you find a solution?
Tag: Feedback, Bug
Maybe related to #988
@buhtzz Yes, I just tried it again and this bug is still present. To replicate
backintime restore <directory>
I didn't read the full linked issue, but my interpretation of this problem is still as per my original issue. When restoring, backintime uses --backup
. e.g. the command it writes to the terminal is:
rsync --recursive --times --devices --specials --hard-links --human-readable --links --acls --xattrs --perms --executability --group --owner --info=progress2 --no-inc-recursive --numeric-ids -R -v --backup --suffix=.backup.20220926 /path/to/backintime/hostname/root/1/20220926-094501-100/backup/./path/to/dir /
As per my original text, the presence of --backup
forces --omit-dir-times
. If I remove the --backup
part from the command above, this preserves modification times as expected.
I can confirm and have reproduced this bug.
The problem only occurs when the "Backup replaced files on restore" option is set (or, for a particular restpore run, the "Backup local files before overwriting or removing […]" option is activated.) When this option is unset, directory mtimes are preserved/restored as expected.
find
and touch
Suggested here, a third run to touch/restore directory mtimes could help, like so:
find $dir -type d -exec touch --reference="$backupdir/{}" "{}" \;
This is likely the most time-efficient way to do it.
As suggested here, a third rsync run could restore directory mtimes after backup files have been written.
--backup-dir $dir
to rsyncThis would be a big change, and would fundamentally alter the way that restore works. With this option, all saved-instead-of-overridden or saved-instead-of-deleted files would not be stored in-place, but in a separate copy of the restored directory structure under $dir.
I just did a
restore
, and I realised that modification times of directories were not preserved. I checked thersync
command, and I realised that it is because backintime uses the--backup
flag when restoring. Fromman rsync
:I'm not sure why that is; it doesn't make sense to me. In any case, my expectation was that backintime would preserve all modification times. Obviously I can see the merit of using
--backup
in general, but when restoring directories, I'd rather manuallyrsync -a
instead, which is less convenient, but preserves all modification times.