User Tools

Site Tools


zfs_backup

ZFS snapshots & backup

One of the great things of ZFS is the easy of use and speed of snapshots. With snapshots, one can create backups on the fly. We use the following simple snapshot schema, especially because most data are datasets, and don't change that often. If faster changing data is stored on the storage server, these schema's may need some modifications (like daily snapshots)'

daily -> remove expired snapshots
weekly backup  -> keep for 7 weeks
montly backup -> keep for 12 months

The tool used to do these snapshots is zfSnap

zfSnap

for more infomation see https://github.com/zfsnap/zfsnap/wiki/zfSnap command to do weekly snapshots

/etc/cron.weekly/zfsnapshots

#!/bin/bash

/usr/sbin/zfSnap  -s -S -a 7w -r data/home

-a → TTL of 7 weeks -r → recursive

/etc/cron.montly/zfsnapshots

#!/bin/bash

/usr/sbin/zfSnap  -s -S -a 12m -r data/home

-a → TTL of 12 months

/etc/cron.daily/zfsnapshots

#!/bin/bash

/usr/sbin/zfSnap  -d -r data/home

-d → clean up expired snapshots -r → recursively

simplesnap

This tool is used to transfert the snapshots from sto3 to sto4. The command is initiated on sto4, via a secured ssh channel.

/etc/cron.daily/simplesnap

#!/bin/bash

simplesnap --host sto3 --setname sto3 --store data/bck --sshcmd "ssh"
zfs_backup.txt · Last modified: 2018/05/17 13:10 by 143.169.49.101