13

Using Duplicity I can make an incremental, efficient backup to an untrusted remote storage. This works fine and I can restore files at a specific point in time (or the next backup after that).

Well now I want to know when in the history of all the backups did a specific file change. File change timestamp and size along with the backup timestamps would be sufficient.

Any way to do that with duplicity?

EDIT: I should clarify that I want to see every change/version to that file and not only the last, e.g. when it was first introduced, when it was change. That might be at multiple backup incremental backups.

Paul
  • 1,890
  • 3
  • 18
  • 24
  • I have filed a wishlist to launchpad for such a feature, FWIW : https://bugs.launchpad.net/duplicity/+bug/1044715 –  Sep 01 '12 at 14:02

5 Answers5

7

Since version 0.7.03 of Duplicity it is possible to list the revisions that a file has changed in:

duplicity collection-status --file-changed 'filename' 'remote-url'
Eborbob
  • 213
  • 3
  • 13
5

There was an answer on the mailing list by Edgar Soldin:

no, you can currently list all backed up versions. duplicity will not tell you when they were changed. this could however be implemented as duplicity internally keeps track of that.

ede/duply.net

So in essence: It is not possible with vanilla duplicity now, but the data is in duplicity metadata.

Paul
  • 1,890
  • 3
  • 18
  • 24
  • 1
    Another data point: Deja dup integrates with gnome and nautilus and if you right-click on a file an "Restore a previous version", it displays all the versions of a file it knows about. Maybe you can check this code and even use it. – AndreasM Jan 02 '12 at 13:21
  • Well dejadup is written in Vala and scripts the command-line of duplicity. I think the code of dejadup doesn't filter for changes of a specific file but just offers all the backups it has, not matter if the file has changed or not. – AndreasM Jan 02 '12 at 15:02
4

YES, it is possible to do this by getting a list of all of the files in each of the snapshots that duplicity takes (i.e. the first full backup and every incremental) and then compare the file lists and look for the specific file you are concerned with.

While it will not show every change to the file unless the file changes less frequently than you make duplicity copies, it will show each state of the file at each backup point.

I wrote a shell script to do this.

masegaloeh
  • 17,978
  • 9
  • 56
  • 104
Geoff
  • 41
  • 1
  • 3
    Geoff, that sounds interesting! Did you publish the script? That seems to be an obvious candidat for inclusion into the standard distribution. – Paul Mar 16 '15 at 13:18
3

You might try dumping the full list of files, then searching that list for the file in question:

duplicity list-current-files url > /path/to/file-list.txt
grep filename /path/to/file-list.txt

This command is poorly documented, but each line in the file has a date that appears to be last modified time.

xofer
  • 3,052
  • 12
  • 19
  • Not what I asked for but thanks for the effort! – Paul Jan 02 '12 at 12:50
  • This appears to show the time stamp in the inode. Not the last time duplicity backed it up. So if someone changes a file and restores the old modification-timestamp, that change will be invisible to this method. – Peter V. Mørch Aug 21 '18 at 17:33
0
duplicity list-current-files --time now "${DEST}" > /tmp/today
duplicity list-current-files --time 1D "${DEST}" > /tmp/yesterday
grep -Fxvf /tmp/{today,yesterday}
Andrew Schulman
  • 8,561
  • 21
  • 31
  • 47
joco
  • 1