[CalendarServer-changes] [4738] CalendarServer/branches/users/cdaboo/deployment-partition-4722/ calendarserver/tools/managepostgres.py
source_changes at macosforge.org
source_changes at macosforge.org
Wed Nov 11 08:30:06 PST 2009
Revision: 4738
http://trac.macosforge.org/projects/calendarserver/changeset/4738
Author: cdaboo at apple.com
Date: 2009-11-11 08:30:03 -0800 (Wed, 11 Nov 2009)
Log Message:
-----------
Add a clean option.
Modified Paths:
--------------
CalendarServer/branches/users/cdaboo/deployment-partition-4722/calendarserver/tools/managepostgres.py
Modified: CalendarServer/branches/users/cdaboo/deployment-partition-4722/calendarserver/tools/managepostgres.py
===================================================================
--- CalendarServer/branches/users/cdaboo/deployment-partition-4722/calendarserver/tools/managepostgres.py 2009-11-11 16:03:18 UTC (rev 4737)
+++ CalendarServer/branches/users/cdaboo/deployment-partition-4722/calendarserver/tools/managepostgres.py 2009-11-11 16:30:03 UTC (rev 4738)
@@ -67,6 +67,10 @@
cmd("%s/bin/postgres %s -D %s/data" % (basedir, "-d 3" if verbose else "", basedir,))
+def doClean(basedir):
+
+ cmd("rm -rf %s/data" % (basedir, basedir,))
+
if __name__ == '__main__':
usage = "%prog [options] ACTION"
@@ -77,6 +81,7 @@
start: start postgres daemon
stop: stop postgres daemon
run: run postgres (non-daemon)
+ clean: remove databases
"""
description = "Tool to manage PostgreSQL"
@@ -103,5 +108,7 @@
doStop(options.basedir)
elif args[0] == "run":
doRun(options.basedir, options.verbose)
+ elif args[0] == "clean":
+ doClean(options.basedir)
else:
parser.error("incorrect argument '%s'" % (args[0],))
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20091111/72eaebdd/attachment.html>
More information about the calendarserver-changes
mailing list