From b699d9b65fe2ef20898f68ad3f015fcb8a26e213 Mon Sep 17 00:00:00 2001 From: hjp Date: Sun, 28 Jun 2009 20:21:14 +0000 Subject: [PATCH] fixed detection of best backup dir. --- backup | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/backup b/backup index 580111e..a194e05 100755 --- a/backup +++ b/backup @@ -35,7 +35,11 @@ my @backup_dirs = map { = statvfs($_); [ $_, $bsize * $bavail ] } glob("/backup/*/active"); -@backup_dirs = sort { $b->[1] <=> $b->[0] } @backup_dirs; +@backup_dirs = sort { $b->[1] <=> $a->[1] } @backup_dirs; +unless (@backup_dirs) { + $ca->log(0, "no backup directory found"); + exit(1); +} $ca->basedir($backup_dirs[0][0]); $ca->run();