Fixup of output for destruction
This commit is contained in:
parent
dfe963e461
commit
918ae78284
2
PKGBUILD
2
PKGBUILD
@ -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'
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user