delete regex from delete block to filter only zfsnap created snapshots

This commit is contained in:
Milan Meduna 2019-09-21 22:11:35 +02:00
parent ba2475aed2
commit cb7d9a4525

View file

@ -62,7 +62,7 @@ for dataset in $source_datasets;
do do
dataset_clean=$(echo $dataset | grep -o '[^/]*$') dataset_clean=$(echo $dataset | grep -o '[^/]*$')
snaps_to_delete=$(echo "$backups_server_zfs_snapshots" | grep "$backup_server_dataset"/"$dataset_clean"@ | grep -E "....-..-.._........--"$zfsnap_days_keep_snaps"d" | head -n -"$backup_server_number_keep_snaps" | cut -d" " -f1) snaps_to_delete=$(echo "$backups_server_zfs_snapshots" | grep "$backup_server_dataset"/"$dataset_clean"@ | head -n -"$backup_server_number_keep_snaps" | cut -d" " -f1)
for snap in $snaps_to_delete for snap in $snaps_to_delete
do do