Skip to content
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

back up atime and ctime #317

Closed
anarcat opened this issue Oct 20, 2015 · 6 comments
Closed

back up atime and ctime #317

anarcat opened this issue Oct 20, 2015 · 6 comments
Milestone

Comments

@anarcat
Copy link
Contributor

anarcat commented Oct 20, 2015

after reviewing this documentation i noticed that only modification times were backed up in borg/attic (source).

is that on purpose? if so, why?

it seems it would be worthwhile to also index the access time, at the very least - and ctime can be valuable during forensics as well...

@ThomasWaldmann
Copy link
Member

iirc, you can't restore them anyway.

@anarcat
Copy link
Contributor Author

anarcat commented Oct 20, 2015

On 2015-10-20 13:26:08, TW wrote:

iirc, you can't restore them anyway.

atime can certainly be restored:

[994]anarcat@marcos:test$ stat foo
  Fichier : « foo »
   Taille : 0           Blocs : 0          Blocs d'E/S : 4096   fichier vide
Périphérique : fe04h/65028d     Inœud : 3707433     Liens : 1
Accès : (0644/-rw-r--r--)  UID : ( 1000/ anarcat)   GID : ( 1000/ anarcat)
 Accès : 2015-10-20 13:28:00.342574329 -0400
Modif. : 2015-10-20 13:28:00.342574329 -0400
Changt : 2015-10-20 13:28:00.342574329 -0400
  Créé : -
[995]anarcat@marcos:test$ touch -r / foo
[996]anarcat@marcos:test$ stat foo
  Fichier : « foo »
   Taille : 0           Blocs : 0          Blocs d'E/S : 4096   fichier vide
Périphérique : fe04h/65028d     Inœud : 3707433     Liens : 1
Accès : (0644/-rw-r--r--)  UID : ( 1000/ anarcat)   GID : ( 1000/ anarcat)
 Accès : 2014-05-14 19:03:45.973953996 -0400
Modif. : 2015-09-28 21:35:32.555686445 -0400
Changt : 2015-10-20 13:28:07.362656450 -0400
  Créé : -

As for ctime, it's possible to "restore" it through various hacks, but
none that seem to make sense to me. What I have read ranges from:

  • changing the clock
  • patching the kernel
  • changing the filesystem directly

All seem a little nuts, and leaving the ctime as-is actually makes sense
on restore, as we do change the file...

However, i think it could still be useful to store it, as we could
inspect it through the FUSE mountpoint, for example... Then it can be
used to check for inconsistencies or issues...

@anarcat
Copy link
Contributor Author

anarcat commented Oct 20, 2015

(wtf github, why isn't markdown supported by email?)

source of the ways to change the ctime: http://stackoverflow.com/questions/4537291/setting-creation-or-change-timestamps

@ThomasWaldmann
Copy link
Member

no, we won't change the clock or patch the kernel or change fs directly.

about saving atime and ctime: yes, that seems reasonable. we just need to be careful to not change it before "reading" it.

@anarcat
Copy link
Contributor Author

anarcat commented Oct 20, 2015

no, we won't change the clock or patch the kernel or change fs directly.

of course, i wasn't suggesting that. :)

about saving atime and ctime: yes, that seems reasonable. we just need to be careful to not change it before "reading" it.

i believe that was fixed in attic a while back, see jborg/attic#113

i guess the next step here is to add atime and ctime to the archive creation, and atime to extraction.

@ThomasWaldmann
Copy link
Member

yup. os.utime().

@ThomasWaldmann ThomasWaldmann changed the title why are atime and ctime not backed up? back up atime and ctime Oct 20, 2015
@ThomasWaldmann ThomasWaldmann added this to the 0.29 milestone Oct 20, 2015
ThomasWaldmann added a commit that referenced this issue Oct 26, 2015
backup atime and ctime additionally to mtime, fixes #317
@ThomasWaldmann ThomasWaldmann modified the milestones: 0.28, 0.29 Nov 15, 2015
@ghost ghost mentioned this issue Jan 26, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants