summaryrefslogtreecommitdiffstats
path: root/pyfirstaidkit
diff options
context:
space:
mode:
authorJoel Andres Granados <jgranado@redhat.com>2008-08-08 14:35:16 +0200
committerJoel Andres Granados <jgranado@redhat.com>2008-08-08 14:35:16 +0200
commit90054c1550faaef35623979d23421b295262ffbf (patch)
treeebb5e23af931c6160c968f093560e8b599f0397f /pyfirstaidkit
parentad7477c7a78117f54843c91afe67259b05768ea4 (diff)
downloadfirstaidkit-90054c1550faaef35623979d23421b295262ffbf.tar.gz
firstaidkit-90054c1550faaef35623979d23421b295262ffbf.tar.xz
firstaidkit-90054c1550faaef35623979d23421b295262ffbf.zip
A time stamp in the backup directory name will help to differentiate them.
Diffstat (limited to 'pyfirstaidkit')
-rw-r--r--pyfirstaidkit/utils/backup.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/pyfirstaidkit/utils/backup.py b/pyfirstaidkit/utils/backup.py
index a0be9e9..e52e9b5 100644
--- a/pyfirstaidkit/utils/backup.py
+++ b/pyfirstaidkit/utils/backup.py
@@ -26,6 +26,7 @@ import weakref
import cPickle as pickle
import copy
import tempfile
+import datetime
class BackupException(Exception):
pass
@@ -255,7 +256,9 @@ class FileBackupStore(BackupStoreInterface):
else:
if not os.path.isdir(rootpath):
os.makedirs(rootpath)
- self._path = tempfile.mkdtemp(prefix = "firstaidkitbackup-", dir = rootpath)
+ timestamp = datetime.datetime.now().strftime("%Y%m%d_%H%m%S")
+ self._path = tempfile.mkdtemp(prefix = "fakbackup-%s-"%timestamp,
+ dir = rootpath)
self._backups = {}