Jump to content

ZFS snapshot and replication script


Recommended Posts

Hi

I plan to use @SpaceInvaderOne‘s ZFS snapshot and replication script, to replace my current backup setup. 
I have two pools

1. data (HDD pool for main data)

2. cache (SSD pool for appdata etc)

 

For data I want to

- Snapshot my data pool

- Replicate the data snapshots to a remote server (zfs)

This is possible straightforward with the script

 

For cache I want to

- Snapshot my cache pool

- Replicate my cache pool to the data pool (locally)

- AND replicate my cache pool the remote server (zfs)

 

As far as I understand the script, I have to choose if I want to replicate locally OR replicate to a remote destination. 
Can it be configured to replicate to both destinations?

 

Another scenario could be pretty handy. 
When I attach a local USB disk I want to only replicate my latest snapshots feom data AND cache to the USB disk without creating a new snapshot. But this may be a whole new script I guess

Edited by UnKwicks
Added second scenario
Link to comment
  • 2 weeks later...

The script has had a change that it can do the following
1. Snapshot and replicate either to a remote server or a local server. There can only be one destination in the script at present.
2. The script can snapshot and replicate a whole zfs pool. You can add exclusions for datasets which you dont want included.
3. It can replicate just one dataset specified
4. It can replicate with zfs replication or also to a location using rsync if the destination doesnt have zfs. (source location still must be zfs as for the rsync replication it mounts the newest snapshot the rsyncs that to destination)

I will not add much more functionality to the script otherwise it just becomes to complicated to set up. I do plan on converting this (maybe) to a plugin at some point in the future when then i will add features
 

Link to comment
  • 4 months later...
On 4/30/2024 at 9:14 PM, SpaceInvaderOne said:

The script has had a change that it can do the following
1. Snapshot and replicate either to a remote server or a local server. There can only be one destination in the script at present.
2. The script can snapshot and replicate a whole zfs pool. You can add exclusions for datasets which you dont want included.
3. It can replicate just one dataset specified
4. It can replicate with zfs replication or also to a location using rsync if the destination doesnt have zfs. (source location still must be zfs as for the rsync replication it mounts the newest snapshot the rsyncs that to destination)

I will not add much more functionality to the script otherwise it just becomes to complicated to set up. I do plan on converting this (maybe) to a plugin at some point in the future when then i will add features
 

 

Ed Nice work on the script as always! 

 

if i change the "update paths" at the end of the script like the photos im posting, to not make a folder like: pool/zfsfolder/pool_zfs_folder and make it like this: pool/zfsfolder to make an exact mirror on the other side? is that a problem? im doing it correctly on the script? 

after.png

before.png

Edited by tgiannak
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...