rsync and appinding to existing files

fixx

Well-Known Member
Joined
Feb 13, 2006
Messages
288
Reaction score
7
Location
South Africa
Hi Guys

I am using backupPC to make backups of some firewalls and stuff for clients. The issue I have is appending of data with rsync.

Lets say I have a file called test.txt and a user edit's that file and adds 50 characters to it, I want only the information that has changed (in other words the 50 characters) to be transferred and appended to the existing file but I can't seem to get it to work.

As a test I create a file called /etc/test using the following command:

dd if=/dev/zero of=test count=1024 bs=1024

That creates a 1MB file. This file I transferred using rsync and then created another file called /etc/test2 and appended it to /etc/test using the command cat test2 >> test.

Then removed test2, so now I have a file with the random data of test2 appended to it. When I do an incremental backup though, the whole file gets transferred again and not appended even when using the --append option to rsync.

Is it possible to transfer only the changes and append it to existing files?

Thanks in advance.
 
Is there a special reason why you are using a mixed data and text file?

Did you also specify --inplace?
 
There is probably a reason for this and I would say that it does this as some files cannot be read by backuppc. Either they are encrypted or are unreadable for what ever reason. Hence why the whole file is transfered again.
 
What is your full rsync command line?
 
Hi Guys

Thanks for the help so far.

The full command from the backuppc server is

/usr/bin/ssh -q -x -l root my.client.co.za /usr/bin/rsync --server --sender --numeric-ids --perms --owner --group -D --links --hard-links --times --block-size=2048 --recursive --append . /
 
Is there a special reason why you are using a mixed data and text file?

Did you also specify --inplace?

I tried with that option now as well (removing --append) still the same result.
 
Top
Sign up to the MyBroadband newsletter
X