[CRIU] [PATCH] p_haul_img: add timestamp in a directory name

Pavel Emelyanov xemul at parallels.com
Thu Mar 20 01:07:54 PDT 2014


On 03/19/2014 11:00 PM, Andrey Vagin wrote:
> IMHO: it's more convenient

An example of how would they looks like would be nice.

> 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
> 




More information about the CRIU mailing list