[CalendarServer-changes] [7104] CalendarServer/trunk/calendarserver/tools/purge.py
source_changes at macosforge.org
source_changes at macosforge.org
Mon Mar 7 16:13:57 PST 2011
Revision: 7104
http://trac.macosforge.org/projects/calendarserver/changeset/7104
Author: wsanchez at apple.com
Date: 2011-03-07 16:13:55 -0800 (Mon, 07 Mar 2011)
Log Message:
-----------
Clean up usage a bit
Modified Paths:
--------------
CalendarServer/trunk/calendarserver/tools/purge.py
Modified: CalendarServer/trunk/calendarserver/tools/purge.py
===================================================================
--- CalendarServer/trunk/calendarserver/tools/purge.py 2011-03-07 13:50:18 UTC (rev 7103)
+++ CalendarServer/trunk/calendarserver/tools/purge.py 2011-03-08 00:13:55 UTC (rev 7104)
@@ -48,6 +48,9 @@
log = Logger()
+DEFAULT_BATCH_SIZE = 100
+DEFAULT_RETAIN_DAYS = 365
+
def usage_purge_events(e=None):
name = os.path.basename(sys.argv[0])
@@ -56,11 +59,11 @@
print " Remove old events from the calendar server"
print ""
print "options:"
- print " -d --days <number>: specify how many days in the past to retain (default=365)"
- print " -b --batch <number>: number of events to remove in each transaction (default=100)"
+ print " -h --help: print this help and exit"
+ print " -d --days <number>: specify how many days in the past to retain (default=%d)" % (DEFAULT_RETAIN_DAYS,)
+ print " -b --batch <number>: number of events to remove in each transaction (default=%d)" % (DEFAULT_BATCH_SIZE,)
print " -f --config <path>: Specify caldavd.plist configuration path"
- print " -h --help: print this help and exit"
- print " -n --dry-run: only calculate how many events to purge"
+ print " -n --dry-run: calculate how many events to purge, but do not purge data"
print " -v --verbose: print progress information"
print ""
@@ -78,10 +81,10 @@
print " Remove orphaned attachments from the calendar server"
print ""
print "options:"
- print " -b --batch <number>: number of attachments to remove in each transaction (default=100)"
+ print " -h --help: print this help and exit"
+ print " -b --batch <number>: number of attachments to remove in each transaction (default=%d)" % (DEFAULT_BATCH_SIZE,)
print " -f --config <path>: Specify caldavd.plist configuration path"
- print " -h --help: print this help and exit"
- print " -n --dry-run: only calculate how many attachments to purge"
+ print " -n --dry-run: calculate how many attachments to purge, but do not purge data"
print " -v --verbose: print progress information"
print ""
@@ -99,9 +102,9 @@
print " Remove a principal's events and contacts from the calendar server"
print ""
print "options:"
+ print " -h --help: print this help and exit"
print " -f --config <path>: Specify caldavd.plist configuration path"
- print " -h --help: print this help and exit"
- print " -n --dry-run: only calculate how many events and contacts to purge"
+ print " -n --dry-run: calculate how many events and contacts to purge, but do not purge data"
print " -v --verbose: print progress information"
print ""
@@ -245,8 +248,8 @@
# Get configuration
#
configFileName = None
- days = 365
- batchSize = 100
+ days = DEFAULT_RETAIN_DAYS
+ batchSize = DEFAULT_BATCH_SIZE
dryrun = False
verbose = False
@@ -317,7 +320,7 @@
# Get configuration
#
configFileName = None
- batchSize = 100
+ batchSize = DEFAULT_BATCH_SIZE
dryrun = False
verbose = False
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20110307/3bc2354e/attachment.html>
More information about the calendarserver-changes
mailing list