restoring from a backup does not retain the original date time stamp of files/dirs

Bug #1251845 reported by graysky
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Back In Time
Confirmed
Wishlist
Unassigned

Bug Description

Can you change the behavior of the rsync call to honor the original DTS on files/dirs when a user chooses to restore a target from a backup set?

Revision history for this message
Germar (germar) wrote :

I'm not sure if I understood your request. DTS is daylight saving time, correct?
AFAIK this doesn't matter as date/times are always stored in UTC Unix time (seconds from 01.01.1970). They will be transformed by tzdata as soon they are displayed with respect on your locale and DST.

Revision history for this message
graysky (graysky) wrote :

No, DTS = date time stamp... you are thinking about DST which is the other :p

Revision history for this message
Germar (germar) wrote :

Oh, stupid me :D
So you're talking about restoring atime and ctime, correct? mtime will be restored because rsync uses mtime and size to check if a file has changed.

For atime you would need to patch rsync with patches/atimes.diff in https://rsync.samba.org/ftp/rsync/src/rsync-patches-3.0.9.tar.gz. But atime will change for files in snapshots, too. So you can't make sure atime is the same after restoring.
AFAIK there is no way to modify ctime as non-root.

Revision history for this message
graysky (graysky) wrote :

Hmm... could be be that the action of a restore does the following: check to see if target exists on file system, if no use archived DTS. If yes, restore file using code as-is.

Is that possible?

Revision history for this message
Germar (germar) wrote :

We could enhance 'Save/Restore permissions' to back up and restore atime into 'fileinfo.bz2'. But only for all files because only rsync knows which file had changed (okay, we could extract that from rsyncs output but that is quite fuzzy). Anyways, rsync will always mess around atime in source path when it transfer changed files.

Just for my own interest: why is it important to restore atime?

Revision history for this message
graysky (graysky) wrote :

Sounds good. To answer your question, I use the DTS on the dir to know when the last time a particular directory has been updated. For example, I recently had a need to restore /home/me/PKGBUILDs which contains 50+ directories. When I did the full restore, the DTS on all the dirs was all the same which is wrong.

Revision history for this message
graysky (graysky) wrote :

...for example, if I restore from a tar backup, the DTS on /home/me/PKGBUILDs will be preserved; restoring from BIT should be the same.

Thanks!

Revision history for this message
Germar (germar) wrote :

Ahh, okay. I think now I get it.
This is not about atime. This is just mtime which WILL be restored by rsync. But that only works for files. Dirs mtime is messed up because as soon as rsync writes a file inside a dir your filesystem will renew mtime for the dir. rsync would need to come back to the parent dir and reset mtime again. I'm not sure if there is such a function.

Changed in backintime:
importance: Undecided → Wishlist
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.