diff options
author | B. Watson <yalhcru@gmail.com> | 2018-06-04 04:01:46 -0400 |
---|---|---|
committer | B. Watson <yalhcru@gmail.com> | 2018-06-04 04:01:46 -0400 |
commit | a54e488454ea4260a0da388113c2952f56afedca (patch) | |
tree | 931bd3c381e005145efab5abf52710c4a8e2ca78 /sbosrcarch | |
parent | 2c15da1b69f0211a93f6ff20f167aa71ffd504bb (diff) | |
download | sbostuff-a54e488454ea4260a0da388113c2952f56afedca.tar.gz |
sbosrcarch purge_mode fix, wip
Diffstat (limited to 'sbosrcarch')
-rwxr-xr-x | sbosrcarch | 16 |
1 files changed, 12 insertions, 4 deletions
@@ -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<purge> I<[-r|--rebuild]> +=item B<purge> 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<CONFIG FILE>) 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<CONFIG FILE>) +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<cannot> 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<trim> @@ -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; } } |