Franziska Kunsmann
479b730be4
All checks were successful
bundlewrap/pipeline/head This commit looks good
21 lines
613 B
Bash
21 lines
613 B
Bash
#!/bin/bash
|
|
|
|
set -euo pipefail
|
|
|
|
run-parts --exit-on-error -- /etc/zfs-snapshot-backup-pre.d
|
|
|
|
|
|
% for dataset in sorted(node.metadata.get('zfs/filesystems_with_backup_snapshots')):
|
|
if zfs get type ${dataset}@snapshot-backup >/dev/null 2>&1
|
|
then
|
|
zfs destroy -f ${dataset}@snapshot-backup
|
|
fi
|
|
|
|
zfs snapshot ${dataset}@snapshot-backup
|
|
|
|
mkdir -p /mnt/backup-snapshot${node.metadata['zfs']['datasets'][dataset]['mountpoint']}
|
|
mount -t zfs ${dataset}@snapshot-backup /mnt/backup-snapshot${node.metadata['zfs']['datasets'][dataset]['mountpoint']}
|
|
|
|
|
|
% endfor
|
|
run-parts --exit-on-error -- /etc/zfs-snapshot-backup-post.d
|