Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

So far I'm backing up my stuff using:

rsync -avz --delete /Local/Location/of/data/ -e ssh username@hostname:/Remote/Location/of/backup

The local side is running Mac OS, and the server side is running Linux. I cannot change this setting.

This works great (as far as I can tell) and transfers only the differences since the last backup, as well as preserving all the permissions etc. However, this approach has one drawback, namely the backup on the server's side is not compressed (and therefore I get warnings). How can I add some compression of the process' end result?

The naive approach would be to (given the destination is compressed):

  1. Uncompress the destination
  2. rsync the differences from local to remote
  3. Compress the backup on the server's side.

What would be the best practice here?

Edit

I came across the notion of "Incremental Dumps". Seems like tar can be helpful here. Is this a way to go?

share|improve this question
    
Try to use some filesystem that does compression. –  Cougar Mar 22 '12 at 8:27
1  
@Cougar You cannot always influence the destination filesystem –  Paul Mar 22 '12 at 13:25
add comment

1 Answer

A simple solution would be to use a compressing file system on the server side. See "Allocation and layout policies" in Wikipedia's "Comparison of file systems" for a list.

Another option is to use a filesystem which offers snapshots or copy-on-write. btrfs would be a good candidate for this since it offers everything but one tiny feature: It's not safe enough for backups, yet. Don't get me wrong: btrfs is great; I'm using it for about a year, now, and never had problems. But backups need to be reliable first and foremost.

Also you often cannot simply create a partition on a server with a file system of your liking. There are two workarounds:

  1. You can create a huge file on the server and create the file system in there (just give mkfs the path to the file instead of a device name). Afterwards, you can mount this file system using mount -o loop file mount-point

  2. If that's not an option but you have FUSE (Filesystem in Userspace) enabled in the server (it's a kernel module), then you can use lessfs.

Lastly, you could use a dedicated backup tool for this task. There are many options (like dar, rsnapshot or google for "linux backup"). But be warned: I searched many years, tried many options and still haven't found anything that is as simple as rsync and a powerful file system.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.