]> git.frykholm.com Git - butterbackup.git/commitdiff
Merge branch 'master' of https://github.com/mikaelfrykholm/butterbackup
authorMikael Frykholm <mikael@backup.codemill.se>
Mon, 23 May 2016 17:49:07 +0000 (19:49 +0200)
committerMikael Frykholm <mikael@backup.codemill.se>
Mon, 23 May 2016 17:49:07 +0000 (19:49 +0200)
README.md
butterbackup.py

index 63397f71e1a4d73d4dffb452099b83fa3432fea0..4014f96121af437540c983ab58d85591e2bc9cd0 100644 (file)
--- a/README.md
+++ b/README.md
@@ -6,12 +6,25 @@ Butterbackup is a backup system which stores snapshots in btrfs on a central ser
 For now it is rather crude. To get started backing up some manual work is needed.
 <pre lang="bash"><code>
 Create /etc/butterbackup
-# echo "--exclude /tmp --exclude /proc --exclude /sys --exclude /dev" > /etc/butterbackup/default.cfg
+# cat > /etc/butterbackup/default.cfg
+[DEFAULT]
+exclude = /proc/, /sys, /tmp, /dev, /run
+store_dir = /mnt/data
+keep=10
+(ctrl-d to exit)
 # touch /etc/butterbackup/machine1.example.com
 # touch /etc/butterbackup/machine2.example.com
 # ssh-copy-id root@machine1.example.com
-# ssh-copy-id root@machine1.example.com
-# mkdir /mnt/data2
+# ssh-copy-id root@machine2.example.com
+# mkdir /mnt/data
 # mkfs.btrfs /dev/sdb1
-# mount /dev/sdb1 /mnt/data2  #hardcoded for now
+# mount /dev/sdb1 /mnt/data
+</code></pre>
+
+To override the default setting for a specific host do:
+<pre lang="bash"><code>
+cat > /etc/butterbackup/machine1.example.com
+[host]
+exclude = /proc/, /sys, /tmp, /dev, /run, /home/mikael/.gvfs, /.snapshots
+keep=20
 </code></pre>
index 99cf3c70ace4e298e815f88abd558f91a86ae997..26822276a29d6449bb03069493c3be4d85ec498e 100755 (executable)
@@ -34,8 +34,10 @@ class Host():
             print(command + excludes + " root@%s:/ "%(self.name) + self.subvol_dir)
             check_call(shlex.split(command + excludes + " root@%s:/ "%(self.name) + self.subvol_dir))
         except CalledProcessError as ex:
-            if ex.returncode not in (12, 30):
-                print("Rsync did not transfer anything from %s, skipping snapshot."%self.name)
+            if ex.returncode in (24,):
+                pass
+            else:
+                print("Rsync error from %s, skipping snapshot. Rsync exit value=%s"%(self.name, ex.returncode))
                 return()
         todays_date = datetime.datetime.now().date().strftime("%F")
         if os.path.exists(os.path.join(self.host_dir, todays_date)):