[CRIU] [PATCH] p_haul_img: add timestamp in a directory name
Andrey Vagin
avagin at openvz.org
Wed Mar 19 12:00:29 PDT 2014
IMHO: it's more convenient
Signed-off-by: Andrey Vagin <avagin at openvz.org>
---
p_haul_img.py | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/p_haul_img.py b/p_haul_img.py
index 032d32a..e582eeb 100644
--- a/p_haul_img.py
+++ b/p_haul_img.py
@@ -8,6 +8,7 @@ import rpyc
import tarfile
import time
import shutil
+import time
img_path = "/var/local/p.haul-fs/"
img_tarfile = "images.tar"
@@ -24,7 +25,8 @@ class phaul_images:
def __init__(self):
self.current_iter = 0
self.current_dir = None
- self.wdir = tempfile.mkdtemp("", "", img_path)
+ prefix = time.strftime("%y.%m.%d-%H.%M-", time.localtime())
+ self.wdir = tempfile.mkdtemp("", prefix, img_path)
self.img_path = os.path.join(self.wdir, "img")
os.mkdir(self.img_path)
self.sync_time = 0.0
--
1.8.5.3
More information about the CRIU
mailing list