[CalendarServer-changes] [1091] CalendarServer/trunk
source_changes at macosforge.org
source_changes at macosforge.org
Tue Jan 23 15:36:44 PST 2007
Revision: 1091
http://trac.macosforge.org/projects/calendarserver/changeset/1091
Author: dreid at apple.com
Date: 2007-01-23 15:36:44 -0800 (Tue, 23 Jan 2007)
Log Message:
-----------
Rename OSX specific backup stuff.
Added Paths:
-----------
CalendarServer/trunk/bin/calendarServer_restore
CalendarServer/trunk/conf/85-calendarServer.plist
Removed Paths:
-------------
CalendarServer/trunk/bin/calendar_restore
CalendarServer/trunk/conf/85-calendar.plist
Copied: CalendarServer/trunk/bin/calendarServer_restore (from rev 1090, CalendarServer/trunk/bin/calendar_restore)
===================================================================
--- CalendarServer/trunk/bin/calendarServer_restore (rev 0)
+++ CalendarServer/trunk/bin/calendarServer_restore 2007-01-23 23:36:44 UTC (rev 1091)
@@ -0,0 +1,92 @@
+#!/usr/bin/env python
+##
+# Copyright (c) 2005-2007 Apple Inc. All rights reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# DRI: David Reid, dreid at apple.com
+##
+
+import os
+import sys
+import fnmatch
+import plistlib
+
+ServiceConf = "85-calendarServer.plist"
+
+configFile = "/private/etc/caldavd/caldavd.plist"
+
+documentRoot = "/Library/CalendarServer/Documents/"
+
+removePatterns = ['.db.sqlite']
+
+
+class Options(dict):
+ def parseOpts(self, argv):
+ for x in xrange(0, len(argv)):
+ opt = argv[x]
+ if opt.startswith('-'):
+ self[opt.strip('-')] = argv[x+1]
+
+
+def cleanDocRoot():
+ root = None
+ if os.path.exists(configFile):
+ root = plistlib.readPlist(configFile)['DocumentRoot']
+
+ if not root and os.path.exists(configFile + '.default'):
+ root = plistlib.readPlist(configFile + '.default')['DocumentRoot']
+
+ if not root:
+ root = documentRoot
+
+ if not root:
+ print "Could not find document root"
+ sys.exit(1)
+
+ removed = []
+
+ for root, dirs, files in os.walk(root):
+ dirs.extend(files)
+ for file in dirs:
+ for pat in removePatterns:
+ if fnmatch.fnmatch(file, pat):
+ full = os.path.join(root, file)
+
+ os.remove(full)
+
+ removed.append(full)
+
+ return removed
+
+
+def cmd_restore(options):
+ cleanDocRoot()
+
+
+if __name__ == '__main__':
+ options = Options({'cmd': None,
+ 'target': None,
+ 'path': None,
+ 'log': None,
+ 'opt': 'all'})
+
+ options.parseOpts(sys.argv[1:])
+
+ cmd = globals().get('cmd_%s' % (options['cmd'],), None)
+
+ if not cmd:
+ print "Unknown Command: %s" % (options['cmd'],)
+ sys.exit(1)
+
+ cmd(options)
Deleted: CalendarServer/trunk/bin/calendar_restore
===================================================================
--- CalendarServer/trunk/bin/calendar_restore 2007-01-23 21:19:46 UTC (rev 1090)
+++ CalendarServer/trunk/bin/calendar_restore 2007-01-23 23:36:44 UTC (rev 1091)
@@ -1,92 +0,0 @@
-#!/usr/bin/env python
-##
-# Copyright (c) 2005-2007 Apple Inc. All rights reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-# DRI: David Reid, dreid at apple.com
-##
-
-import os
-import sys
-import fnmatch
-import plistlib
-
-ServiceConf = "85-calendarServer.plist"
-
-configFile = "/private/etc/caldavd/caldavd.plist"
-
-documentRoot = "/Library/CalendarServer/Documents/"
-
-removePatterns = ['.db.sqlite']
-
-
-class Options(dict):
- def parseOpts(self, argv):
- for x in xrange(0, len(argv)):
- opt = argv[x]
- if opt.startswith('-'):
- self[opt.strip('-')] = argv[x+1]
-
-
-def cleanDocRoot():
- root = None
- if os.path.exists(configFile):
- root = plistlib.readPlist(configFile)['DocumentRoot']
-
- if not root and os.path.exists(configFile + '.default'):
- root = plistlib.readPlist(configFile + '.default')['DocumentRoot']
-
- if not root:
- root = documentRoot
-
- if not root:
- print "Could not find document root"
- sys.exit(1)
-
- removed = []
-
- for root, dirs, files in os.walk(root):
- dirs.extend(files)
- for file in dirs:
- for pat in removePatterns:
- if fnmatch.fnmatch(file, pat):
- full = os.path.join(root, file)
-
- os.remove(full)
-
- removed.append(full)
-
- return removed
-
-
-def cmd_restore(options):
- cleanDocRoot()
-
-
-if __name__ == '__main__':
- options = Options({'cmd': None,
- 'target': None,
- 'path': None,
- 'log': None,
- 'opt': 'all'})
-
- options.parseOpts(sys.argv[1:])
-
- cmd = globals().get('cmd_%s' % (options['cmd'],), None)
-
- if not cmd:
- print "Unknown Command: %s" % (options['cmd'],)
- sys.exit(1)
-
- cmd(options)
Deleted: CalendarServer/trunk/conf/85-calendar.plist
===================================================================
--- CalendarServer/trunk/conf/85-calendar.plist 2007-01-23 21:19:46 UTC (rev 1090)
+++ CalendarServer/trunk/conf/85-calendar.plist 2007-01-23 23:36:44 UTC (rev 1091)
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
- <key>ServiceName</key>
- <string>calendarServer</string>
-
- <key>RestoreBinaryPath</key>
- <string>/usr/libexec/sbs_backup/calendar_restore</string>
- <key>RestoreLog</key>
- <string>/private/var/log/sbs_backup/calendar_restore.log</string>
- <key>RestoreActions</key>
- <dict>
- <key>Default</key>
- <string>all</string>
- <key>Browse</key>
- <string>browse</string>
- </dict>
-
- <key>Version</key>
- <string>10.5</string>
-</dict>
-</plist>
Copied: CalendarServer/trunk/conf/85-calendarServer.plist (from rev 1090, CalendarServer/trunk/conf/85-calendar.plist)
===================================================================
--- CalendarServer/trunk/conf/85-calendarServer.plist (rev 0)
+++ CalendarServer/trunk/conf/85-calendarServer.plist 2007-01-23 23:36:44 UTC (rev 1091)
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>ServiceName</key>
+ <string>calendarServer</string>
+
+ <key>RestoreBinaryPath</key>
+ <string>/usr/libexec/sbs_backup/calendarServer_restore</string>
+ <key>RestoreLog</key>
+ <string>/private/var/log/sbs_backup/calendarServer_restore.log</string>
+
+ <key>Version</key>
+ <string>10.5</string>
+</dict>
+</plist>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20070123/d993600b/attachment.html
More information about the calendarserver-changes
mailing list