zfsnap_fix
This commit is contained in:
parent
24cfaec0a9
commit
45e63e31a2
2 changed files with 11 additions and 3 deletions
|
@ -6,7 +6,8 @@ backup_server_dataset="tank/backups"
|
|||
backup_server_delete_old_snaps=y
|
||||
backup_server_number_keep_snaps=31
|
||||
|
||||
#Source server settings NOT CHANGE AFTER FIRST FULL BACKUP!
|
||||
#Source server settings
|
||||
#DO NOT CHANGE zfsnap_days_keep_snaps AFTER FIRST FULL BACKUP!
|
||||
|
||||
zfsnap_enable=y
|
||||
zfsnap_days_keep_snaps=7
|
||||
|
|
|
@ -1,13 +1,20 @@
|
|||
#!/bin/bash
|
||||
(
|
||||
flock -n 200 || { echo 'locked via flock on file /var/lock/zfs-backup-mm' ; exit 1; }
|
||||
|
||||
zfsnap_block () {
|
||||
|
||||
IFS='
|
||||
'
|
||||
if [ $zfsnap_enable = "y" ]; then
|
||||
for dataset in $source_datasets;
|
||||
do
|
||||
echo "Creating snapshot on "$dataset""
|
||||
zfSnap -d -a "$zfsnap_days_keep_snaps"d "$dataset"
|
||||
echo "Tuning zfSnap for "$dataset""
|
||||
for command in $(zfSnap -n -d -zpool28fix -a "$zfsnap_days_keep_snaps"d "$dataset" | grep "$dataset")
|
||||
do
|
||||
echo "Doing "$command""
|
||||
eval "$command";
|
||||
done
|
||||
done
|
||||
backup_block
|
||||
else
|
||||
|
|
Loading…
Reference in a new issue