diff options
-rwxr-xr-x | byteback-prune | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/byteback-prune b/byteback-prune index f93b8c5..b3afe42 100755 --- a/byteback-prune +++ b/byteback-prune @@ -90,9 +90,6 @@ debug("Disc free #{@free}%, 30m gradient = #{gradient_30m}") def snapshots_in_order list = BackupDirectory.all_snapshots - if list.empty? - warn("Couldn't find any snapshots (yet?)") - end if @order == 'importance' Snapshot.sort_by_importance(list) elsif @order == 'age' @@ -124,5 +121,10 @@ exit 0 unless File.exists?(PRUNING_FLAG) && @do_prune exit 0 unless @do_prune_force || gradient_30m == 0 +if snapshots.empty? + error("No snapshots to delete, is there enough disc space?") + exit 1 +end + info("Deleting #{snapshots.last.path}") log_system("sudo btrfs subvolume delete #{snapshots.last.path}") |