Snapshot nested datasets?

Status
Not open for further replies.

oguruma

Patron
Joined
Jan 2, 2016
Messages
226
I am considering switching to ZFS snapshots instead of Rsync for a backup solution.

My question is, can FreeNAS avoid backing up child datasets in nested datasets? In my main dataset I have a backup location for all the workstations on my LAN. I don't want to back that stuff up.

For example, on NAS-1, I have /mnt/mydataset and mnt/mydataset/backupdataset nested inside.

I want to snaphot /mnt/mydataset but not the /mnt/mydataset/backupdataset that is nested inside.

If I set Snapshots not use recursive mode, will it backup /mnt/mydataset but exclud /mnt/mydataset/backupdataset?
 

Havock2

Dabbler
Joined
Apr 15, 2016
Messages
25
I have a script the destroys unneeded snapshots. You can schedule your backups to run after these are deleted.

Code:
#!/bin/bash

for snapshot in `zfs list -H -t snapshot | cut -f 1 | egrep '<Volume Name>/<Dataset Name>/<Nested Dataset Name 1>@auto-|<Dataset Name>/<Nested Dataset Name 2>@auto-'`
do
zfs destroy $snapshot
echo Destroyed $snapshot
done


This way I can have 1 rule for snapshot creation and all new datasets and zvols are snapshotted by default.
 
Status
Not open for further replies.
Top