Should I backup a dataset from a snapshot?

Status
Not open for further replies.

Ahmed Badr

Dabbler
Joined
Sep 3, 2015
Messages
13
Hi,

I want to backup some FreeNAS data sets to a non-ZFS Linux server on the same network. I have periodic snapshot tasks configured for these datasets and I would like to backup from the latest snapshot rather than from the live dataset which might be changing.
The latest snapshot is located in (.zfs/snapshot/auto-20161030.749-2m). The directory name constantly changes depending on the date and time the snapshot was taken. Obviously I need a fixed path for the backup program to access my data.
Is there a way/script to link the latest snapshot folder to a fixed path like (.zfs/snapshot/yesterday)?

Or is there a better way to do backups?

Thanks
 

Robert Trevellyan

Pony Wrangler
Joined
May 16, 2014
Messages
3,778
Or is there a better way to do backups?
Probably. First of all, step back from trying to use the .zfs folder for this. Ideally, create a ZFS pool on the Linux server and use the standard snapshot replication process. Alternatively, if you can't create a ZFS pool on the Linux server, zfs send the most recent snapshot through ssh to a file at the other end.
 

Robert Trevellyan

Pony Wrangler
Joined
May 16, 2014
Messages
3,778
OK, but what the reason not to?
It's fair question. The truth is, you can use the .zfs folder if you really want to, and maybe it's the right solution for you, but you'd be working at a level below the tools ZFS provides specifically for the job. Let's assume you decide to write a script that can identify the most recent snapshot. You could have it work by listing the contents of the .zfs folder ( ls -l), or you could have it work by listing the snapshots ( zfs list -t snapshot). The latter script wouldn't be any harder to write, and it could zfs send the contents of the snapshot to your other system, which would preserve the full structure of the filesystem. If you used the contents of the .zfs folder, then you'd be looking at something like rsync for the replication, which would not preserve the full structure of the filesystem.
 
Status
Not open for further replies.
Top