I have a local FreeNAS system and want to use ZFS snapshots for backups.
FreeNAS has the built-in Replication Tasks which use
zfs send snapshot_name
to send a snapshot to a remote system. But this needs a system with ZFS on the other end.
I want to send the snapshot to a a file and send this compressed and encrypted file to the remote machine.
This is possible with
zfs send snapshot_name | gzip | openssl enc -aes-256-cbc -a -salt > file.gz.ssl
Everyday I make a snapshot of the storage pool and keep every snapshot for 30 days.
With every snapshot taken I'll pipe this snapshot to a file.
- snapshot_file 1 has every file in it (let's say 2GB)
- snapshot_file 2 only has the changes to snapshot_file 1 (let's say 5MB)
- snapshot_file 3 holds the changes to snapshot_file 2; and so on.
On day 31 snapshot_file 1 is getting deleted (because I only want the changes from the last 30 days)
Therefore snapshot_file 2 needs to hold every file (2GB of snapshot_file 1 + 5MB changes)
But with this approach everyday (from day 31 on) a new 2GB file has to be created and send to a remote system. This is too much overhead.
What would be the best approach to use snapshots piped to a file as a backup strategy with a history of X days?
P.S.: I know there are a lot of backup software out there (rdiff-backup for example), which I could use. But I am curious how this could be done.