summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormailman1998-02-25 00:06:31 +0000
committermailman1998-02-25 00:06:31 +0000
commit83e5aa26b6d345aa5a4080b85a2e09360823e700 (patch)
tree8390ef4ea1144a5e0a336552b23c955e1620d476
parent459786da3d357d7b3d4c8b7f1e043b22a2814a3e (diff)
downloadmailman-83e5aa26b6d345aa5a4080b85a2e09360823e700.tar.gz
mailman-83e5aa26b6d345aa5a4080b85a2e09360823e700.tar.zst
mailman-83e5aa26b6d345aa5a4080b85a2e09360823e700.zip
Initial revision
-rwxr-xr-xcron/upvolumes_monthly33
1 files changed, 33 insertions, 0 deletions
diff --git a/cron/upvolumes_monthly b/cron/upvolumes_monthly
new file mode 100755
index 000000000..4e8d3a179
--- /dev/null
+++ b/cron/upvolumes_monthly
@@ -0,0 +1,33 @@
+#!/usr/local/bin/python
+
+# This script gets called by cron at 12:00 am the first of each month
+# It bumps the volume number up by one on each list, and resets
+# The digest number.
+
+import sys, os
+
+sys.path.append('/home/mailman/mailman/modules')
+
+import maillist, mm_cfg
+
+
+dirs = os.listdir(mm_cfg.LIST_DATA_DIR)
+for dir in dirs:
+ if not (os.path.exists(os.path.join(
+ os.path.join(mm_cfg.LIST_DATA_DIR, dir), 'config.db'))):
+ continue
+ try:
+ list = maillist.MailList(dir)
+ except:
+ continue
+ list.UpdateArchive()
+ if list.archive_volume_frequency == 1:
+ # Remove old INDEX file, as it will never be used again, and eats
+ # up disk space.
+ os.unlink(os.path.join(list.archive_directory, "volume_%d/INDEX" %
+ list.volume))
+ list.volume = list.volume + 1
+ list.next_digest_number = 1
+ list.Save()
+ list.Unlock()
+