summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormailman1998-02-22 04:14:24 +0000
committermailman1998-02-22 04:14:24 +0000
commit6618f12a918a15261c68533b812583d3e232c8c0 (patch)
treecf689155d7a8ed1d22e7abb3479d958683da85ba
parent32777ded6d0c75314ed7f417f15ceeac04da4f9f (diff)
downloadmailman-6618f12a918a15261c68533b812583d3e232c8c0.tar.gz
mailman-6618f12a918a15261c68533b812583d3e232c8c0.tar.zst
mailman-6618f12a918a15261c68533b812583d3e232c8c0.zip
Instead of take list names, take level of update, and operate on all
lists configured with that level update frequency or greater (according to archive_update_frequency setting). So, eg, if dailies are level 1 and hourlies are level 2, then all hourlies would be updated for both level 1 and level 2 updates. Importantly, the list names are not taken as arguments, so the crontab needn't be changed once the level policies (hourly, daily, whatever) are implemented in it.
-rwxr-xr-xcron/archive27
1 files changed, 21 insertions, 6 deletions
diff --git a/cron/archive b/cron/archive
index 3e1e58004..1107b9cb3 100755
--- a/cron/archive
+++ b/cron/archive
@@ -1,17 +1,32 @@
#!/usr/local/bin/python
#
# This script gets called by cron.
-# It updates the archive for all mailing lists.
+# It updates the archive for all mailing lists with update-frequency equal
+# to or greater than the specified archive level.
import sys
-
sys.path.append('/home/mailman/mailman/modules')
-
import maillist, mm_cfg
-for list_name in sys.argv[1:]:
+def usage():
+ sys.stderr.write("Usage: %s level\n" % sys.argv[0])
+ sys.stderr.write("\twhere level is an integer, "
+ "typically 1=daily, 2=hourly")
+
+if len(sys.argv) != 2:
+ usage()
+ raise SystemExit, 1
+try:
+ level = int(sys.argv[1])
+except ValueError:
+ usage()
+ raise SystemExit, 1
+
+for name in maillist.list_names():
+
+ list = maillist.MailList(name)
- list = maillist.MailList(list_name)
- list.UpdateArchive()
+ if level <= list.archive_update_frequency:
+ list.UpdateArchive()
list.Unlock()