X-Git-Url: https://git.sthu.org/?p=sitarba.git;a=blobdiff_plain;f=sitarba;h=6f7cf5b69242c641ef61ab22c3d63e2cbe480b34;hp=c8f18e5dc58a198c3cc9844c303c7e1a5c870727;hb=HEAD;hpb=c3a6f2863145621fceec0f69f9563042ec6cb926 diff --git a/sitarba b/sitarba index c8f18e5..6f7cf5b 100755 --- a/sitarba +++ b/sitarba @@ -143,7 +143,7 @@ class Backup: agestr = "(%s h)" % int(total_hours) else: agestr = "(%s d)" % age.days - return "%16s %7s %10s %4s" % ( + return "%16s %9s %10s %4s" % ( self.date.strftime("%Y-%m-%d %H:%M"), agestr, self.epoch, self.mode) @@ -513,7 +513,7 @@ class BackupManager: # Create new backup directory basedir = self.conf.backupdir dirname = Backup.getDirName(now, epoch, mode) - tmpdirname = dirname + ("-%x" % (random.random()*2e16) ) + tmpdirname = dirname + ("-%x" % int(random.random()*2e16) ) targetdir = os.path.join(basedir, tmpdirname) os.mkdir(targetdir) @@ -532,6 +532,7 @@ class BackupManager: self.backupFileSet(s, targetdir, excludes, since) logfile.info("Stopped: " + datetime.datetime.now().ctime()) + fil.close() # Rename backup directory to final name os.rename( targetdir, os.path.join(basedir, dirname) )