rsync and appinding to existing files

fixx

Well-Known Member
Joined
Feb 13, 2006
Messages
278
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.
 

Nod

Honorary Master
Joined
Jul 22, 2005
Messages
10,057
Is there a special reason why you are using a mixed data and text file?

Did you also specify --inplace?
 

Murlin

Active Member
Joined
Dec 11, 2008
Messages
69
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.
 

fixx

Well-Known Member
Joined
Feb 13, 2006
Messages
278
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 . /
 

fixx

Well-Known Member
Joined
Feb 13, 2006
Messages
278
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