X-Git-Url: https://git.sthu.org/?p=sitarba.git;a=blobdiff_plain;f=shbackup;h=e57e2508500fe22a966357413cb6d398c73a9f20;hp=cd2443727f6ddf851e25c12ded9f4cd9f4f85795;hb=49e5f540ea30ec5a28a98dc560a34cfcace55d2f;hpb=1279c0a182af8138af63506425692e36450481eb diff --git a/shbackup b/shbackup index cd24437..e57e250 100755 --- a/shbackup +++ b/shbackup @@ -1,7 +1,7 @@ #!/usr/bin/python3 """A simple backup solution.""" -__version__ = "0.1" +__version__ = "2.0" __author__ = "Stefan Huber" import datetime @@ -172,7 +172,7 @@ class Config: def __init__(self): self.backupdir = None - self.format = self.formats[0] + self.format = self.formats[1] self.tarbin = "/bin/tar" self.excludes = [] self.sets = [] @@ -241,7 +241,7 @@ class Config: if not e.mode in Modes: raise Config.ReadError("Invalid mode '{0}'.".format(e.mode)) - elif opt=="timedelta": + elif opt=="timespan": if name in Epoch.units: raise Config.ReadError("The time delta of a standard epoch " + \ "is not supposed to be redefined. ") @@ -251,7 +251,7 @@ class Config: e.unit = unit e.mult = mult except ValueError as e: - raise Config.ReadError("Invalid timedelta '{0}': {1}".format(td, str(e))) + raise Config.ReadError("Invalid timespan '{0}': {1}".format(td, str(e))) elif opt.startswith("exclude"): e.excludes += [config.get(sec, opt)] @@ -439,7 +439,8 @@ class BackupManager: if rett != 0: for l in errmsg.decode().split("\n"): logfile.error(l) - logfile.error(tarpath + " returned with exit status " + str(rett) + ".") + logfile.error(self.conf.tarbin + " returned with exit status " + \ + str(rett) + ".") def backup(self, epoch=None, mode=None): @@ -595,11 +596,11 @@ def printUsage(): print("") print("Options:") print(" -h, --help print this usage text") - print(" -c, --conf use given configuration file") + print(" -c, --conf FILE use given configuration file") print(" default: /etc/shbackup.conf") - print(" -e, --epoch force to create backup for given epoch:") - print(" year, month, week, day, hour, sporadic") - print(" -m, --mode override mode: full, diff, or incr") + print(" -e, --epoch EPOCH force to create backup for given epoch, which") + print(" can be 'sporadic' or one of the configured epochs") + print(" -m, --mode MODE override mode: full, diff, or incr") print(" -v, --verbose be more verbose and interact with user") print(" --verbosity LEVEL set verbosity to LEVEL, which can be") print(" error, warning, info, debug")