#!/bin/sh previous_snapshot=$(zfs list -t snapshot -H -o name -r Datenspeicher | sort | tail -n2 | head -n1) current_snapshot=$(zfs list -t snapshot -H -o name -r Datenspeicher | sort | tail -n1) echo "PREV: $previous_snapshot" echo "CUR: $current_snapshot" file_name=$(echo "$current_snapshot" | cut -f2 -d"/") cd /mnt/Datenspeicher/snap-backup-dataset/temporary-backups/ zfs send -I $previous_snapshot $current_snapshot | gzip > $file_name.gz scp -i ../backup_key $file_name.gz zfs_snap_backup@etha.cpi.imtek.uni-freiburg.de:~/zfs-backups/ && rm $file_name.gz # Restoring Backups: # # cd /mnt/Datenspeicher/snap-backup-dataset/temporary-backups/ # scp -i ../backup_key zfs_snap_backup@etha.cpi.imtek.uni-freiburg.de:~/zfs-backups/ tmp-backup-file.gz # gunzip -c tmep-backup-file.gz | zfs receive -F Datenspeicher/test-backup # rm tmp-backup-file.gz