diff options
Diffstat (limited to 'build/lib/Bcfg2/Server/Admin/Backup.py')
-rw-r--r-- | build/lib/Bcfg2/Server/Admin/Backup.py | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/build/lib/Bcfg2/Server/Admin/Backup.py b/build/lib/Bcfg2/Server/Admin/Backup.py deleted file mode 100644 index d6458f97d..000000000 --- a/build/lib/Bcfg2/Server/Admin/Backup.py +++ /dev/null @@ -1,33 +0,0 @@ -import glob -import os -import sys -import time -import tarfile -import Bcfg2.Server.Admin -import Bcfg2.Options - -class Backup(Bcfg2.Server.Admin.MetadataCore): - __shorthelp__ = "Make a backup of the Bcfg2 repository." - __longhelp__ = (__shorthelp__ + "\n\nbcfg2-admin backup") - #"\n\nbcfg2-admin backup restore") - __usage__ = ("bcfg2-admin backup") - - def __init__(self, configfile): - Bcfg2.Server.Admin.MetadataCore.__init__(self, configfile, - self.__usage__) - - def __call__(self, args): - Bcfg2.Server.Admin.MetadataCore.__call__(self, args) - # Get Bcfg2 repo directory - opts = {'repo': Bcfg2.Options.SERVER_REPOSITORY} - setup = Bcfg2.Options.OptionParser(opts) - setup.parse(sys.argv[1:]) - self.datastore = setup['repo'] - timestamp = time.strftime('%Y%m%d%H%M%S') - format = 'gz' - mode = 'w:' + format - filename = timestamp + '.tar' + '.' + format - out = tarfile.open(self.datastore + '/' + filename, mode=mode) - out.add(self.datastore, os.path.basename(self.datastore)) - out.close() - print "Archive %s was stored under %s" % (filename, self.datastore) |