You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
879 B
23 lines
879 B
5 years ago
|
#!/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/<backup-file> tmp-backup-file.gz
|
||
|
# gunzip -c tmep-backup-file.gz | zfs receive -F Datenspeicher/test-backup
|
||
|
# rm tmp-backup-file.gz
|