fixed detection of best backup dir.

This commit is contained in:
hjp 2009-06-28 20:21:14 +00:00
parent 0b5aa8283b
commit b699d9b65f
1 changed files with 5 additions and 1 deletions

6
backup
View File

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