Author: eelco Date: Sat Aug 27 16:59:32 2011 New Revision: 28852 URL: https://svn.nixos.org/websvn/nix/?rev=28852&sc=1
Log: * Update the cleanup script. Modified: nix/trunk/scripts/maintenance/gc-commands nix/trunk/scripts/maintenance/gc-releases.pl nix/trunk/scripts/maintenance/readcache.pm Modified: nix/trunk/scripts/maintenance/gc-commands ============================================================================== --- nix/trunk/scripts/maintenance/gc-commands Sat Aug 27 15:29:18 2011 (r28851) +++ nix/trunk/scripts/maintenance/gc-commands Sat Aug 27 16:59:32 2011 (r28852) @@ -1,2 +1,2 @@ -./gc-releases.pl /data/webserver/dist/*/*/MANIFEST > dead -cat dead | xargs mv --target-directory=/data/webserver/trash/ +./gc-releases.pl /data/releases/patches/all-patches $(find /data/releases -name MANIFEST) | sort > dead +cat dead | xargs -d '\n' sh -c 'find "$@" -mtime +100 -print' | xargs -d '\n' mv -v --target-directory=/data/releases/trash/ Modified: nix/trunk/scripts/maintenance/gc-releases.pl ============================================================================== --- nix/trunk/scripts/maintenance/gc-releases.pl Sat Aug 27 15:29:18 2011 (r28851) +++ nix/trunk/scripts/maintenance/gc-releases.pl Sat Aug 27 16:59:32 2011 (r28852) @@ -1,8 +1,9 @@ -#! /usr/bin/perl -w -I. -I.. +#! /var/run/current-system/sw/bin/perl -w -I. -I.. use strict; -use readmanifest; +use NixManifest; use readcache; +use File::Basename; # Read the manifests. @@ -49,6 +50,9 @@ foreach my $archive (keys %readcache::archives) { next if $archive eq "." || $archive eq ".."; if (!defined $usedFiles{$archive}) { - print $readcache::archives{$archive}, "\n"; + my $file = $readcache::archives{$archive}; + print "$file\n"; + my $hashFile = dirname($file) . "/.hash." . basename($file); + print "$hashFile\n" if -e $hashFile; } } Modified: nix/trunk/scripts/maintenance/readcache.pm ============================================================================== --- nix/trunk/scripts/maintenance/readcache.pm Sat Aug 27 15:29:18 2011 (r28851) +++ nix/trunk/scripts/maintenance/readcache.pm Sat Aug 27 16:59:32 2011 (r28852) @@ -9,13 +9,13 @@ opendir(DIR, "$dir") or die "cannot open `$dir': $!"; my @as = readdir DIR; foreach my $archive (@as) { + next unless $archive =~ /^sha256_/ || $archive =~ /\.nar-bsdiff$/ || $archive =~ /\.nar\.bz2$/; $archives{$archive} = "$dir/$archive"; } closedir DIR; } -readDir "/data/webserver/dist/nix-cache"; -readDir "/data/webserver/dist/test-cache"; -readDir "/data/webserver/dist/patches"; +readDir "/data/releases/nars"; +readDir "/data/releases/patches"; print STDERR scalar (keys %archives), "\n"; _______________________________________________ nix-commits mailing list nix-comm...@cs.uu.nl http://mail.cs.uu.nl/mailman/listinfo/nix-commits