How to compress files before Rsnapshot remote backup start? [closed]

The question is, WHY do you want compression?

Compression to improve transfer speed

If you want to compress the speed of the transfer, you can add a parameter to rsync to enable on-the-fly compression during the transfer:

rsync_short_args -az (source)

Compression to reduce space requirements on backup disk

rsnapshot seems to deal rather badly with compressed backups. I found a solution to compress files on the backup server:

(...) SOME of the files in the (2nd & beyond) archive sets can be compressed, those that aren't in a linked set.

find daily.1 -links 1 -size +1M ! -name "*.bz2" -print | grep -v \.svn | xargs pbzip2 -v

Revert

find daily.1 -links 1 -name "*.bz2" -print | xargs pbzip2 -d -v

Only run that against the 2nd archive set (e.g hourly.1, daily.1 or weekly.1) of the shortest in your configuration.

(source).

If you want to reduce the space requirements without interference, you could also use transparent compression on the destination file system itself. I know that ZFS and BTRFS offer this natively. If your hard drive is an SSD, it might already do a transparent compression internally for all your files.