summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFabian Affolter <fabian@bernewireless.net>2010-12-03 01:52:34 +0100
committerSol Jerome <sol.jerome@gmail.com>2010-12-07 20:21:59 -0600
commit1d8a9780d38b095ac2e67e3aeb5e436c756b719a (patch)
treee91040b2bb59d2f64e63922d0ae1e0d3b6d5de83 /src
parent22fedd5bf837233fc59340634f6cd7e81717a2d1 (diff)
downloadbcfg2-1d8a9780d38b095ac2e67e3aeb5e436c756b719a.tar.gz
bcfg2-1d8a9780d38b095ac2e67e3aeb5e436c756b719a.tar.bz2
bcfg2-1d8a9780d38b095ac2e67e3aeb5e436c756b719a.zip
Fixed backup location
(cherry picked from commit c9eec98340168b1e9e3f4877b15b681855ee696b)
Diffstat (limited to 'src')
-rw-r--r--src/lib/Server/Admin/Backup.py9
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'