ZFS snapshot lifetime and replication to another system

I have been using Truenas for over a year, but very new to zfs snapshots and replications etc. I have read a few posts, but haven’t found a answer for this yet.

My setup is as per below:
Prod:
TrueNas scale 24.04.2
64GB ram
2 x 16TB drivers in a mirror (14.45 TB total usable space)

Local backup:
OMV 7 + promox kernel for zfs
16GB ram
1 x 16TB drive as stripe/basic

I have setup periodic snapshots in TrueNas that run once a day at 12AM and a scheduled replication to send the snapshots to OMV for backup.
It has been running fine for over a week now and i have been checking to make sure the changes get replicated in OMV.
The snapshot lifetime is set at 1 week and the replication task has “same as source” set it its settings.

Although this backup machine doesn’t really consume much power, I don’t want it to run 24x7 since energy prices are getting insane in Australia. And this OMV machine doesn’t do anything else and is purely for backup only.

The current process for my backup is to minimise power consumption is:

  1. Backup machine(OMV) is scheduled to turn on at 3AM everyday
  2. Replication task in TrueNas is scheduled to run at 3:15AM
  3. OMV shuts down at 5AM - more than enough time for the replication to complete as my data doesn’t change a lot day to day.

My question is, since the snapshot lifetime is only set to 1 week, if my backup machine doesn’t turn on for more than a week, will some data not be backed up?
As the snapshot would have been deleted from the TrueNas prod machine after a week.

I have alerts setup on both systems, so will know as soon as the task fails. However if I am on vacation or away for extended periods I don’t want to risk not backing up.

Exactly. Backup will stop working entirely. If source and destination do not have a common snapshot, incremental replication is not possible. You need to start from scratch in that case.

2 Likes

Tick the “save pending snapshots” box in the replication task.

Pending snapshots will then only be deleted after they are replicated, even if they have expired.

2 Likes

TIL, thanks.

1 Like

This is exactly what I was looking for. Thank you.

Is it worth ticking the “Replication from Scratch” checkbox?

You don’t want to tick that.

It will erase the destination if necessary, and start from scratch if there are no base snaps.

I think it’s better to have an error in the case, so you can take action… for example, by replicating from scratch, and then once recovered, disabled again.

1 Like

Is it fair to surmise that it only helps in that way if you do push replication because it only keeps snapshots tied to specifically FAILED tasks and only the source would have all that information available to it?

Think so. But I haven’t tested pull.

1 Like

If only this was an integrated fallback. If only…

2 Likes