Fixup of output for destruction

This commit is contained in:
Daniel de Cloet 2024-02-09 14:42:01 +01:00
parent dfe963e461
commit 918ae78284
2 changed files with 3 additions and 3 deletions

View File

@ -1,6 +1,6 @@
# Maintainer: Daniel <daniel.de.clooet@yoursurprise.com>
pkgname=zfs-snapshotter
pkgver=0.0.1
pkgver=0.0.2
pkgrel=1
pkgdesc='Systemd snapshotter tool'

View File

@ -59,11 +59,11 @@ class Dataset
def clean_up_old_snapshots
snapshots_to_delete = get_all_snapshots.drop_tail(SNAPSHOTS_TO_RETAIN)
p snapshots_to_delete
puts "Deleting the following snapshots: #{snapshots_to_delete.join(", ")}"
return if snapshots_to_delete.length == 0
output, could_delete_old_snapshots = run_command("zfs", "destroy", "#{@name}@#{snapshots_to_delete.first}%#{snapshots_to_delete.last}")
output, could_delete_old_snapshots = run_command("zfs", "destroy", "-v", "#{@name}@#{snapshots_to_delete.first}%#{snapshots_to_delete.last}")
raise "Could not delete old snapshots for #{@name}" unless could_delete_old_snapshots
end
end