diff options
author | Fabian Affolter <fabian@bernewireless.net> | 2010-12-03 01:52:34 +0100 |
---|---|---|
committer | Fabian Affolter <fabian@bernewireless.net> | 2010-12-03 01:52:34 +0100 |
commit | c9eec98340168b1e9e3f4877b15b681855ee696b (patch) | |
tree | 8bf4ed32395a247d30f3de0d32f73257ce0ab14c /src/lib/Server/Admin/Backup.py | |
parent | a5f0c8b9936eb55283b3a2bb03e048842c773b45 (diff) | |
download | bcfg2-c9eec98340168b1e9e3f4877b15b681855ee696b.tar.gz bcfg2-c9eec98340168b1e9e3f4877b15b681855ee696b.tar.bz2 bcfg2-c9eec98340168b1e9e3f4877b15b681855ee696b.zip |
Fixed backup location
Diffstat (limited to 'src/lib/Server/Admin/Backup.py')
-rw-r--r-- | src/lib/Server/Admin/Backup.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/lib/Server/Admin/Backup.py b/src/lib/Server/Admin/Backup.py index 583f0329c..f150b9cf0 100644 --- a/src/lib/Server/Admin/Backup.py +++ b/src/lib/Server/Admin/Backup.py @@ -1,4 +1,5 @@ import glob +import os import sys import time import tarfile @@ -21,7 +22,7 @@ class Backup(Bcfg2.Server.Admin.MetadataCore): opts = {'repo': Bcfg2.Options.SERVER_REPOSITORY} setup = Bcfg2.Options.OptionParser(opts) setup.parse(sys.argv[1:]) - repo = setup['repo'] + self.datastore = setup['repo'] if len(args) == 0: self.errExit("No argument specified.\n" @@ -31,12 +32,12 @@ class Backup(Bcfg2.Server.Admin.MetadataCore): format = 'gz' mode = 'w:' + format filename = timestamp + '.tar' + '.' + format - out = tarfile.open(filename, mode=mode) - content = os.listdir(os.getcwd()) + out = tarfile.open(self.datastore + '/' + filename, mode=mode) + content = os.listdir(self.datastore) for item in content: out.add(item) out.close() - print "Archive %s was stored.\nLocation: %s" % (filename, datastore) + print "Archive %s was stored.\nLocation: %s" % (filename, self.datastore) elif args[0] == 'restore': print 'Not implemented yet' |