From a54e488454ea4260a0da388113c2952f56afedca Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Mon, 4 Jun 2018 04:01:46 -0400 Subject: sbosrcarch purge_mode fix, wip --- sbosrcarch | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'sbosrcarch') diff --git a/sbosrcarch b/sbosrcarch index 8810261..7d96c49 100755 --- a/sbosrcarch +++ b/sbosrcarch @@ -115,15 +115,23 @@ quickly and not eat many resources. For each new URL, the file is downloaded and added to the archive, but the old file is *not* deleted (use 'sbosrcarch purge' to do that). -=item B I<[-r|--rebuild]> +=item B I<[-r|--rebuild]>|I<[-f|--fake]> Purge files from the archive that are no longer referenced by any .info file. Should be run monthly or quarterly as a cron job. This is more resource-intensive than an update, as it must read and parse every .info file in the SBo repository. -If -r or --rebuild is given, the entire by-md5 tree is deleted and recreated. -This shouldn't be needed unless $symlinks (see B) is changed. +If -r or --rebuild is given, the entire by-md5 tree is deleted and +recreated. This shouldn't be needed unless $symlinks (see B) +is changed, or something catastrophic happens to the by-md5 tree. Don't +do this automatically from cron: while it's running, your archive users +will see an incomplete by-md5 tree. + +If -f or --fake is given, a list of files to be purged will be produced, +but nothing will actually be deleted. This option B be combined +with -r/--rebuild, and no warning will be given if it's tried: whichever +option occurs first will take effect, and the other one will be ignored! =item B @@ -1313,7 +1321,7 @@ sub purge_pass_3_wanted { #print "keep md5sum: $md5sum\n"; } else { print "purge $_\n"; - rmtree($_) unless $fake_purge; + rmtree(md5_dir($_)) unless $fake_purge; } } -- cgit v1.2.3