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();