diff options
| author | mailman | 1998-02-25 00:07:08 +0000 |
|---|---|---|
| committer | mailman | 1998-02-25 00:07:08 +0000 |
| commit | c5c86a58b84ff8c2ed02a30be7f9cd6a3372695a (patch) | |
| tree | 827aba355f0172fc3f6c30b2f9eabcf1e526dd92 | |
| parent | 83e5aa26b6d345aa5a4080b85a2e09360823e700 (diff) | |
| download | mailman-c5c86a58b84ff8c2ed02a30be7f9cd6a3372695a.tar.gz mailman-c5c86a58b84ff8c2ed02a30be7f9cd6a3372695a.tar.zst mailman-c5c86a58b84ff8c2ed02a30be7f9cd6a3372695a.zip | |
Initial revision
| -rwxr-xr-x | cron/upvolumes_yearly | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/cron/upvolumes_yearly b/cron/upvolumes_yearly new file mode 100755 index 000000000..ead20d194 --- /dev/null +++ b/cron/upvolumes_yearly @@ -0,0 +1,33 @@ +#!/usr/local/bin/python + +# This script gets called by cron at 12:00 am new years day every year. +# It bumps the volume number up by one on each list, and resets +# The digest number to 0. + +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 == 0: + # 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() + |
