Changed the code that cleans up the old nightly releases from

time-based to count-based (keeping the newest 10 items).
This commit is contained in:
Wayne Davison
2007-03-08 02:00:48 +00:00
parent f41152d393
commit 085e2fd588

View File

@@ -96,7 +96,15 @@ foreach my $fn (qw( rsync.yo rsyncd.conf.yo )) {
unlink($fn);
}
system "find . -name 'rsync-HEAD-*' -daystart -mtime +14 | xargs rm -f";
my $cnt = 0;
open(PIPE, '-|', 'ls -1t rsync-HEAD-*') or die $!;
while (<PIPE>) {
chomp;
next if $cnt++ < 10;
unlink($_);
}
close PIPE;
system 'ls -ltr';
if ($upload) {