From 93d7f769e027bb21f42e25b4a5c6c017d2dc5cc1 Mon Sep 17 00:00:00 2001
From: Mikael Frykholm <mikael@frykholm.com>
Date: Mon, 23 May 2016 20:02:01 +0200
Subject: [PATCH 1/1] Applied patch from tuttle@somsants.net.

---
 butterbackup.py | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/butterbackup.py b/butterbackup.py
index 2682227..110077c 100755
--- a/butterbackup.py
+++ b/butterbackup.py
@@ -29,10 +29,15 @@ class Host():
                 return() 
             
         command = ("rsync -a --acls --xattrs --whole-file --numeric-ids --delete --delete-excluded --human-readable --inplace ")
-        excludes = " --exclude " + " --exclude ".join(self.config.get("host", "exclude").split(',')) #FIXME
+        if self.config.has_option("host", "include"):
+            includes = " --include " + " --include ".join(self.config.get("host", "include").split(',')) #FIXME
+            command = command + includes
+        if self.config.has_option("host", "exclude"):
+            excludes = " --exclude " + " --exclude ".join(self.config.get("host", "exclude").split(',')) #FIXME
+            command = command + excludes
         try:
-            print(command + excludes + " root@%s:/ "%(self.name) + self.subvol_dir)
-            check_call(shlex.split(command + excludes + " root@%s:/ "%(self.name) + self.subvol_dir))
+            print(command + " root@%s:/ "%(self.name) + self.subvol_dir)
+            check_call(shlex.split(command + " root@%s:/ "%(self.name) + self.subvol_dir))
         except CalledProcessError as ex:
             if ex.returncode in (24,):
                 pass
-- 
2.39.5