rdiff-backup-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [rdiff-backup-users] why does exclude move files to increments?


From: David
Subject: Re: [rdiff-backup-users] why does exclude move files to increments?
Date: Tue, 4 Sep 2007 21:41:48 +0200

On 8/31/07, Brandon Saxe <address@hidden> wrote:
> I want to use rdiff-backup to do incrementals, but I
> also only want to process files that have changed in
> the last 24 hours.

I think you can use a variation of the logic I described earlier, to
work around limitations in rdiff-backup exclude filters (maybe
rdiff-backup should get a --no-delete-excluded option, which has the
opposite effect to rsync's --delete-excluded option).

Assuming you have these 3 locations:

<source> - source to be backed up
<dest> - destination to back up to
<temp_dest> - Temporary destination directory, on the same partition as <dest>

1) Prepare <temp_dest>, using <dest>:

rsync --delete --link-dest=<dest> <dest> <temp_dest>

Now <temp_dest> is the same as <dest>. This step goes really quickly,
and <temp_dest> uses very little space on the disk. <temp_dest> only
contains directories, and hardlinks to files under <dest>.

2) Sync over the changed files you're interested in, to <temp_dest>:

rsync <source> <temp_dest> --link-dest=<dest> [rsync filter options]

[rsync filter options] can be fairly complex depending on your needs.
You may need to add a step earlier where you use 'find' to generate
the files to copy over, then use rsync's '--include-from=FILE' option.

Also, unlike rdiff-backup, rsync exclude options don't delete excluded
files at the dest unless you specify '--delete-excluded'.

Side note: This is only safe because rsync creates temporary filenames
for changed files at the dest, then removes the dest file and renames
the temp file. If you use rsync's "update in place" option then you'll
update data in the files directly (under both <dest> and <temp_dest>,
due to us using hardlinks). This would seriously confuse rdiff-backup.

3) Use rdiff-backup to get reverse increments (of just the data you're
interested in, you set it up in step 2):

rdiff-backup --no-compare-inode <temp_dest> <dest>

--no-compare-inode is necessary, because the inode of hard links under
<temp_dest> changes each time you re-create <temp_dest>. Otherwise
rdiff-backup will waste time comparing files with themselves.

4) Tidy up temp directory:

rm -r <temp_dest>

If you skip this step then you probably don't need the
'--no-compare-inode' arg in step 3. But you get an untidy temporary
directory lying about (to preserve the hardlink inodes).

David.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]