X-Git-Url: https://git.sthu.org/?p=sitarba.git;a=blobdiff_plain;f=shbackup;fp=shbackup;h=0cfc4c74f3a03f5a0d2c846ef7c191f11600770f;hp=a45305e59ae8e9f1f88f28126065bfd457618c8c;hb=8a63842725558d8877a933bbd1f5312bb8e6f195;hpb=570c75b02f2ed72f43e1cb5246f497165fe2aff6 diff --git a/shbackup b/shbackup index a45305e..0cfc4c7 100755 --- a/shbackup +++ b/shbackup @@ -57,8 +57,14 @@ class Backup: ", mode: " + self.mode + "]" def colAlignedString(self): - return "%16s %8s %4s" % ( \ - self.date.strftime("%Y-%m-%d %H:%M"), self.epoch, self.mode) + age = datetime.datetime.now() - self.date + total_hours = age.total_seconds()/3600 + if total_hours <= 48: + agestr = "(%s h)" % int(total_hours) + else: + agestr = "(%s d)" % age.days + return "%16s %7s %8s %4s" % ( \ + self.date.strftime("%Y-%m-%d %H:%M"), agestr, self.epoch, self.mode) @staticmethod def getDirName(date, epoch, mode):