Making incremental backup with Rsync

I have a disk UFS mounted on /media/datos and I have a folder on my main HDD where I want to save the incremental back up, /usr/home/USER/bkup.

rsync -avz /media/datos /usr/home/USER/bkup

It says that with the -z option it will compress but it does not compress and it just copies all from one location to another. Also it says that rsync makes incremental backups by default, but.

Does anyone know which options I need to use to copy all from the origin to one single compressed file? Thanks again.
 
freesbies said:
Sorry:

# dd if=/media/datos of=/usr/home/USER/bkup/image | gzip -9 /usr/home/USER/bkup/image


Code:
gzip: can't stat: /usr/home/USER/bkup/image: 1+0 records in
1+0 records out
512 bytes transferred in 0.000041 secs (12485370 bytes/sec)
No such file or directory
 
What's your output when you do this: # dd if=/media/datos of=/usr/home/USER/bkup/image

And what's your hard disk drive path?
 
freesbies said:
What's your output when you do this:
# dd if=/media/datos of=/usr/home/USER/bkup/image

And what's your hard disk drive path?

Code:
# dd if=/media/datos of=/usr/home/USER/bkup/image
1+0 records in
1+0 records out
512 bytes transferred in 0.015518 secs (32994 bytes/sec)

I do not understand what you mean with the "hard disk drive path".
 
wblock@ said:
Please do not use dd(1) as a backup tool. It is terrible at that. See Backup Options For FreeBSD.

rsync(1)'s -z option means it will compress the data before sending it to another system, and it will be decompressed on arrival. It is for reducing network transfer time, not compressing a backup.

Yes I read that in your guide, I mean about dd but this is getting me a little crazy. I am still trying with different options, rsync makes an awesome backup, my problem is that it is not compressed and it re-makes it each time. I need that each time save that backups in a different file, like bk1.gz, bk2.gz (or .whatever).
 
ZFS with compression enabled and daily snapshots, is pretty much perfect for "incremental" backups via rsync. Create a ZFS filesystem, enable compression, use rsync to transfer the initial data over. Then create a snapshot. Next day, rsync the same data overtop the ZFS filesystem. rsync will only copy over changes to the files (this the incremental part). Create new snapshot. Repeat the rsync +snapshot each day.

Voila! Incremental snapshots, and all your files are accessible at all times in the snapshots.
 
Well, after testing it for several days I found that it does not make another folder. It just made a folder called Weekly.0 and then each time it runs it overwrites the same folder. I need that each week makes different folders.
 
Can I use the command cp or another copy command to copy a file to a folder but with the option to not replace. I mean I have bk.tgz, can cp or other command copy the file and auto set to rename it in case if the file exist?. Like bk.tgz bk2.tgz and so on.
 
Back
Top