]> git.parisson.com Git - yomguy-tools.git/commitdiff
renaming
authoryomguy <yomguy@457c0346-1240-4656-8a5a-9edca8063506>
Mon, 7 Jan 2008 22:21:07 +0000 (22:21 +0000)
committeryomguy <yomguy@457c0346-1240-4656-8a5a-9edca8063506>
Mon, 7 Jan 2008 22:21:07 +0000 (22:21 +0000)
git-svn-id: http://svn.parisson.org/svn/tools/trunk@24 457c0346-1240-4656-8a5a-9edca8063506

zope_backup.py [new file with mode: 0755]
zope_backup_all.py

diff --git a/zope_backup.py b/zope_backup.py
new file mode 100755 (executable)
index 0000000..62bee5a
--- /dev/null
@@ -0,0 +1,39 @@
+#!/usr/bin/python
+# Backups all zope instances (any versions)
+#
+# Depends : zope_instance.py
+# Copyright (C) 2007 Guillaume Pellerin
+
+import os
+import sys
+from zope_instance import *
+
+version = '0.1'
+info = 'zope_backup v'+version+'\n'+
+       """Usage: zope_backup DIRECTORY
+       where DIRECTORY is the folder where you want to backup 
+       the instances of the different versions of zope."""
+
+if len(sys.argv) < 2:
+    sys.exit(info)
+else :
+    backup_dir = sys.argv[1]
+
+z = ZopeInstall()
+instances = z.get_instances()
+instance_main_dir = z.instance_main_dir
+
+def backup_all():
+    for version in instances:
+       for instance in instances[version]:
+            z = ZopeInstance(version, instance)
+           print z.get_instance_dir()
+            z.backup(backup_dir)
+           print version + ': ' + instance + ' backuped !'
+
+if __name__ == '__main__':
+    backup_all()
+    print "Backup_all Zopes done !"
+
+    
+        
index 34378eab8edc1400abec3f7d21a2ea5bc71a4555..62bee5a21458a10e55729cb70f3bf45cdbdc8d1d 100755 (executable)
@@ -2,13 +2,22 @@
 # Backups all zope instances (any versions)
 #
 # Depends : zope_instance.py
+# Copyright (C) 2007 Guillaume Pellerin
 
 import os
 import sys
 from zope_instance import *
 
+version = '0.1'
+info = 'zope_backup v'+version+'\n'+
+       """Usage: zope_backup DIRECTORY
+       where DIRECTORY is the folder where you want to backup 
+       the instances of the different versions of zope."""
 
-backup_dir = '/home/momo/backups/zope/'
+if len(sys.argv) < 2:
+    sys.exit(info)
+else :
+    backup_dir = sys.argv[1]
 
 z = ZopeInstall()
 instances = z.get_instances()