From 0402db28f86723f067a71073adbc4672905932a3 Mon Sep 17 00:00:00 2001 From: yomguy Date: Mon, 7 Jan 2008 22:21:07 +0000 Subject: [PATCH] renaming git-svn-id: http://svn.parisson.org/svn/tools/trunk@24 457c0346-1240-4656-8a5a-9edca8063506 --- zope_backup.py | 39 +++++++++++++++++++++++++++++++++++++++ zope_backup_all.py | 11 ++++++++++- 2 files changed, 49 insertions(+), 1 deletion(-) create mode 100755 zope_backup.py diff --git a/zope_backup.py b/zope_backup.py new file mode 100755 index 0000000..62bee5a --- /dev/null +++ b/zope_backup.py @@ -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 !" + + + diff --git a/zope_backup_all.py b/zope_backup_all.py index 34378ea..62bee5a 100755 --- a/zope_backup_all.py +++ b/zope_backup_all.py @@ -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() -- 2.39.5