updating sample shbackup.conf
authorStefan Huber <shuber2@gmx.at>
Mon, 21 May 2012 07:54:39 +0000 (09:54 +0200)
committerStefan Huber <shuber2@gmx.at>
Mon, 21 May 2012 07:54:39 +0000 (09:54 +0200)
shbackup
shbackup.conf

index c74cd2b5fa8f66e8d8936f93974dca14f00d26f0..a13b96559f636573489ee479fc297a24f2f25481 100755 (executable)
--- a/shbackup
+++ b/shbackup
@@ -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):
index 8e39e8bfc5582e3dcef6a34a82403abee1da65d0..e000ed9ff359e04b079c08a329ff460b5f6082b3 100644 (file)
@@ -1,27 +1,14 @@
-[destination]
+[global]
 # Where shbackup stores the backups and other stuff
-directory = /media/backup
+backupdir = /media/backup
+
 # Which format should be used by tar?
-# One of tar, tar.gz, tar.bz2, tar.xz
-format = tar.gz
-
-[history]
-# keepEPOCH contains the number of backups that are kept for that particular
-# epoch, where EPOCH can be year, month, week, day, or hour. If the number is 0
-# then no backup iscreated for that epoch. modeEPOCH defines the backup mode
-# for that particular epoch. Mode can be full, diff or incr.
-keephour = 1
-keepday  = 14
-keepweek = 2
-keepmonth = 12
-keepyear  = 2
-modehour = incr
-modeday = diff
-modeweek = full
-modemonth = full
-modeyear = full
-
-[input]
+# One of tar, tar.gz (default), tar.bz2, tar.xz
+#format = tar.gz
+
+# Path ot the tar binary. (Default: /bin/tar)
+#tarbin = /bin/tar
+
 # Each option starting with "exclude" contains a single --exclude pattern for
 # tar. Files matching the pattern are not included into the backup. Tar is
 # invoked with "-C /" and, thus, exclude patterns refering to absolute paths
@@ -29,8 +16,50 @@ modeyear = full
 exclude1 = */tmp/*
 exclude2 = */[Cc]cache/*
 exclude3 = */log*
-exclude5 = ./home/*/.wine/*
-exclude7 = ./lib/layman/*
+exclude4 = *.o
+
+
+
+# Configure the epoch 'hour'. If left out no hourly backups are made. The
+# epochs hour, day, week, month and year already define a timespan which cannot
+# be overridden.
+[epoch hour]
+# The number of backups to keep for that epoch (positive integer)
+numkeeps = 4
+# The mode of this epoch. Can be one of 'full', 'diff', 'incr'. (Default: full)
+mode = incr
+# Each option starting with "exclude" defines an --exclude pattern for tar.
+# These exclude patterns only apply to this epoch.
+exclude1 = ./home/*/.thunderbird/*
+
+
+# [epoch day]
+# numkeeps = 14
+# mode = diff
+
+# [epoch week]
+# numkeeps = 8
+# mode = full
+
+# [epoch month]
+# numkeeps = 24
+# mode = full
+
+# [epoch year]
+# numkeeps = 99
+# mode = full
+
+
+# Configure a user-defined epoch called 'biweek'.
+[epoch biweek]
+numkeeps = 13
+mode = full
+# The timespan of this epoch in the format '<unit>' or '<integer> * <unit>',
+# where <integer> must be positive and <unit> must be one of 'hour', 'day',
+# 'week', 'month', 'year'.
+timespan = 2*week
+
+
 
 # A file set called 'home'. Each file set is packed into one archive using tar.
 [set home]
@@ -38,6 +67,10 @@ exclude7 = ./lib/layman/*
 # this file set.
 dir1 = /home/username/
 dir2 = /media/books/
+# Each option starting with "exclude" defines an --exclude pattern for tar.
+# These exclude patterns only apply to this file set.
+exclude1 = ./home/*/media/*
+
 
 [set conf]
 dir1 = /etc/