[CalendarServer-changes] [8606] CalendarServer/trunk/calendarserver/tools/backup_pg.py

source_changes at macosforge.org source_changes at macosforge.org
Sun Jan 29 18:08:51 PST 2012


Revision: 8606
          http://trac.macosforge.org/projects/calendarserver/changeset/8606
Author:   dre at apple.com
Date:     2012-01-29 18:08:49 -0800 (Sun, 29 Jan 2012)
Log Message:
-----------
Target the whole ConfigRoot intead of just caldavd.plist

Modified Paths:
--------------
    CalendarServer/trunk/calendarserver/tools/backup_pg.py

Modified: CalendarServer/trunk/calendarserver/tools/backup_pg.py
===================================================================
--- CalendarServer/trunk/calendarserver/tools/backup_pg.py	2012-01-29 23:45:06 UTC (rev 8605)
+++ CalendarServer/trunk/calendarserver/tools/backup_pg.py	2012-01-30 02:08:49 UTC (rev 8606)
@@ -33,8 +33,6 @@
 USERNAME      = "caldav"
 DATABASENAME  = "caldav"
 DUMPFILENAME  = "db_backup"
-PLISTPATH     = "%s/etc/caldavd/caldavd.plist" % (SIPP,)
-PLISTNAME     = "caldavd.plist"
 
 PSQL          = "%s/usr/bin/psql" % (SIPP,)
 PGDUMP        = "%s/usr/bin/pg_dump" % (SIPP,)
@@ -162,6 +160,7 @@
     serverRoot = config.ServerRoot
     dataRoot = config.DataRoot
     docRoot = config.DocumentRoot
+    configRoot = config.ConfigRoot
 
     if command == "backup":
 
@@ -180,11 +179,11 @@
                 print "Adding %s" % (docRoot,)
             tar.add(docRoot, "Documents")
             if verbose:
+                print "Adding %s" % (configRoot,)
+            tar.add(configRoot, "Config")
+            if verbose:
                 print "Adding %s" % (tmpPath,)
             tar.add(tmpPath, DUMPFILENAME)
-            if verbose:
-                print "Adding %s" % (PLISTPATH,)
-            tar.add(PLISTPATH, PLISTNAME)
             tar.close()
 
             if verbose:
@@ -212,6 +211,11 @@
                     print "Removing old DocumentRoot: %s" % (docRoot,)
                 rmtree(docRoot)
 
+            if os.path.exists(configRoot):
+                if verbose:
+                    print "Removing old ConfigRoot: %s" % (configRoot,)
+                rmtree(configRoot)
+
             if verbose:
                 print "Extracting from backup file: %s" % (filename,)
             tar.extractall()
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20120129/bde3458c/attachment-0001.html>


More information about the calendarserver-changes mailing list