[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [rdiff-backup-users] file-by-file changes from one backup to the nex
From: |
Henrik |
Subject: |
Re: [rdiff-backup-users] file-by-file changes from one backup to the next |
Date: |
Sat, 18 Jun 2011 00:19:34 +0200 |
User-agent: |
Mutt/1.5.20 (2009-06-14) |
After taking another look at the file_statistcs.*.data.gz files
and at the ListChangedSince method, I decided that it was
too much of a hassle to look for all the data after the change
has happened.
Instead I went to the source of my problem (being the lack of detailed
logs about changes) and I think I've found _the_ place to fix it.
The function Increment(new, mirror, incpref) in increment.py
There during the backup I have access to old file in the current
backup (mirror), the new file that goes into the backup (new), and
the increment/snapshot file that has been created to record the
difference (incrp)
I added those lines just before the return statement:
log.Log(" mirror: " + str(mirror) + '\n', 5)
log.Log(" new: " + str(new) + '\n' , 5)
log.Log(" incrp: " + str(incrp) + '\n', 5)
and here's what I get when backing up after changing the
file "foo.txt" by adding one byte:
...
Incrementing mirror file /backup/rdiff-backup/foto/foo.txt
mirror: Path: /backup/rdiff-backup/foto/foo.txt
Index: ('foo.txt',)
Data: {'uid': 1000, 'perms': 420, 'type': 'reg', 'gname': 'users', 'ctime':
1308345824, 'devloc': 65025L, 'uname': 'hlangos', 'nlink': 1, 'gid': 100,
'mtime': 1308345695, 'atime': 1308346895, 'inode': 9043973L, 'size': 4L}
new: Path: /backup/rdiff-backup/foto/rdiff-backup.tmp.1
Index: ('rdiff-backup.tmp.1',)
Data: {'uid': 1000, 'perms': 420, 'type': 'reg', 'gname': 'users', 'ctime':
1308346896, 'devloc': 65025L, 'uname': 'root', 'nlink': 1, 'gid': 100, 'mtime':
1308346866, 'atime': 1308346895, 'inode': 9043974L, 'size': 5L}
incrp: Path:
/backup/rdiff-backup/foto/rdiff-backup-data/increments/foo.txt.2011-06-17T23:22:56+02:00.diff.gz
Index: ('foo.txt.2011-06-17T23:22:56+02:00.diff.gz',)
Data: {'uid': 1000, 'perms': 420, 'type': 'reg', 'gname': 'root', 'ctime':
1308346896, 'devloc': 65025L, 'uname': 'root', 'nlink': 1, 'gid': 100, 'mtime':
1308345695, 'atime': 1308346896, 'inode': 13254662L, 'size': 125L}
So pretty much everything that I need is there.
I'll just have to write a function that goes through that data (and does some
extra checks for directories, devices, symlinks ... and the deletion and
addition
of files.)
I'll probably not send a patch upstream as I will not have time
for more than the most basic functionality and I wouldn't want to
burden somebody with cleaning up my mess and adding all the error
handling that I will not need in my very limited use case.
(Just wanted to get this into the archive, in case somebody else
has a similar problem and needs a pointer to (hopefully) the right place)
cheers
-henrik