replication - remove old datasets

GunbleR

Dabbler
Joined
Apr 6, 2018
Messages
10
Hi.
Running TrueNAS Core-13.0-U3.1 atm.
I use pereodic snapshot+replication to copy to backup machine.
When i delete a dataset from source(ex. jail), it will stay on backup machine even past its expiry date.
is there a setting to remove expired datasets on destination in replication settings?
What happens when i have dataset "test1", replicate it, delete it on source and create new dataset "test1"?

my replication settings:
1673385255333.png
 

Whattteva

Wizard
Joined
Mar 5, 2013
Messages
1,824
Datasets don't "expire". That's a terminology for snapshots.
 
Joined
Oct 22, 2019
Messages
3,641
Datasets don't "expire". That's a terminology for snapshots.
Second on this. What do you mean by "past its expiry date"?


When i delete a dataset from source(ex. jail), it will stay on backup machine even past its expiry date.
Putting aside the term "expiry", if you use zfs send/recv in the command-life, there is an option on the receiving end: -F

This will destroy any datasets and snapshots on the destination, which no longer exist on the source. (I'm not sure which option in the TrueNAS GUI applies to that.)


What happens when i have dataset "test1", replicate it, delete it on source and create new dataset "test1"?
I believe if it's encrypted, it will refuse to replace/overwrite the destination dataset. Not sure about non-encrypted datasets.
 

Whattteva

Wizard
Joined
Mar 5, 2013
Messages
1,824
Second on this. What do you mean by "past its expiry date"?
I think this is what he is referring to, but again... it's snapshot terminology, not dataset.
snapshot.png
'

Also, this does NOT apply to snapshots that have been replicated to other machines as indicated in the last paragraph on the screenshot below.
1673389152437.png
 

GunbleR

Dabbler
Joined
Apr 6, 2018
Messages
10
yes. i meant snapshot expiry date. i got dataset which based on snapshot ssd_b-20220909.0100-1w which still exist on backup(and it its only snapshot).
Putting aside the term "expiry", if you use zfs send/recv in the command-life, there is an option on the receiving end: -F

This will destroy any datasets and snapshots on the destination, which no longer exist on the source. (I'm not sure which option in the TrueNAS GUI applies to that.)
I didnt see the option in GUI and "replication from scratch" doesnt seem to help ether.
Prob my best option is to write manual replication commands with recieve -F and run them manually once in blue moon.
thanks.
 

Whattteva

Wizard
Joined
Mar 5, 2013
Messages
1,824
I think what you need to do (delete datasets that don't exist on the source system) requires the -R command on the sending side. On the GUI, I believe it's the "(Almost) Full Filesystem Replication" option.
 
Top