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

Andrew Vagin avagin at parallels.com
Thu Mar 20 04:46:48 PDT 2014


On Thu, Mar 20, 2014 at 12:07:54PM +0400, Pavel Emelyanov wrote:
> 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.

/var/local/p.haul-fs/14.03.20-15.46-JhC3ok/

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