A bit fo help needed with rysnc

In order to try and get my moved /var working through boot I’m going to try cloning it and /tmp onto the new drive with a bootable iso. The man page on rsync is pretty huge and masses of options which I think I have understood correctly but would like to check with some one.

I intend to use

rsync -aXS   ???/var    other/var

What bothers me is comments I have seen on the web that seem to imply that no compression needs to be specified. If I looks in man -a doesn’t include any compression so I assume that isn’t needed. X I understand and S should be used in case there are any sparse files being copied.

Am I correct that the above doesn’t produce a compressed copy?


Compression during transmission is handled by “ssh” – assuming that you use that as the transport. You can specify that in “.ssh/config” (personal settings) and “/etc/ssh/ssh_config” (system wide settings).

If the “rsync” is all being done on one computer, then there’s probably not much point to compression – you are working at I/O channel speed anyway.

If you are just making a backup, and want the backup to be compressed, then you need different backup software.

Compression is used, as I understand it, for transfers to remote machines.
Your options seem to be OK, but be aware of the slashes!

rsync -aXS   ???/var    other/var

will result in : other/var/var


Thanks - good point. I might have missed that. Need to make it var/. or maybe ./ to var.

One reason I thought that the comment on the web was incorrect was that -z adds compression. There doesn’t seem to be one to reverse that though.


No - for the folder /var and all its contents to end up in /other, you need

/var/     /other/