I am using Rsnapshot to backup my server files to a remote server. To minimize the file size, I want to tar the backup files, but I don't know how to do it with Rsnapshot.
Can anyone help me with this? Any help would be grateful. Thank You.
I am using Rsnapshot to backup my server files to a remote server. To minimize the file size, I want to tar the backup files, but I don't know how to do it with Rsnapshot.
Can anyone help me with this? Any help would be grateful. Thank You.
You can use the cmd_postexec
configuration setting to run a custom script after rsnapshot completes. This script can then do anything you want.
However, tarring the files after the fact will, if anything, increase the disk usage. Probably by a lot. By default, rsnapshot passes options to rsync such that rsync hardlinks any unchanged files to the previous revision of the same file.
The only way around the third point above that I can see would be to tar the entire target directory structure (the one named by snapshot_root
in rsnapshot's configuration) but you would then need to untar it before rsnapshot starts running rsync (this can be done through a script executed through cmd_preexec
if you really want to do it), then re-tar it afterwards. This will approximately double the peak disk space usage as well as significantly increase the time needed to run through a rsnapshot execution, for no real benefit at all.
Just use rsnapshot the way it was intended. It's easier, and I don't see it having any downsides that would be solved by religiously running tar
on the backups.
If you have a specific issue with how rsnapshot keeps the copies, then focus on that, not on tar (which may or may not be a solution to whatever issue you might be having).