[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [rdiff-backup-users] Adding SHA1Digest to existing backup
From: |
Andrew Ferguson |
Subject: |
Re: [rdiff-backup-users] Adding SHA1Digest to existing backup |
Date: |
Sat, 14 Feb 2009 09:31:01 -0500 |
On Feb 13, 2009, at 6:09 PM, Maarten Bezemer wrote:
I have a number of rdiff-backup repo's that started quite a while
ago. With the current version I'm using, changing (or newly added)
files get an extra line in the metadata showing the SHA1 digest of
the file.
But older files that haven't changes in many months do not have this
information in the metadata.
Is there a way to have rdiff-backup calculate these hashes for all
files currently in the repo (only the current version would be
enough; previous versions would just not have the checksum and be
fine without it).
There isn't a way to have rdiff-backup to do it. However, it is easy
to script yourself.
You can generate the SHA1 sums using the openssl command (for example):
$ openssl sha1 /path/to/file
The SHA1 hashes are stored in the mirror_metadata file, which is
inside the rdiff-backup-data dir, and is simply a (gzip'd) text file.
Here's an example entry:
File foo
Type reg
Size 5
SHA1Digest 4cbd040533a2f43fc6691d773d510cda70f4126a
ModTime 1234621688
Uid 501
Uname owsla
Gid 0
Gname wheel
Permissions 420
For every entry of "Type reg", without a SHA1Digest line, simply add
in that line.
Andrew