pvl.backup-snapshot: fix --link-dest for initial backup run
authorTero Marttila <terom@paivola.fi>
Thu, 24 May 2012 13:48:04 +0300
changeset 59 b9c014c353a3
parent 58 99d59876e05b
child 60 3402a85f9baa
pvl.backup-snapshot: fix --link-dest for initial backup run
TODO
bin/pvl.backup-snapshot
--- a/TODO	Thu May 24 13:08:08 2012 +0300
+++ b/TODO	Thu May 24 13:48:04 2012 +0300
@@ -1,6 +1,12 @@
 TODO:
     run other targets even if one target fails due to a error (but fail on bugs...) (base class Exception?)
 
+    fix logging exec/scriptname prefix
+
+    stats: total/changed files/bytes
+
+    config: [target] exclude = ...
+
 0.3.0:
     pvl.backup.mount: mount without readonly fails to omit --options arg
     XXX: rsync-snapshot clean_interval removes newest items
--- a/bin/pvl.backup-snapshot	Thu May 24 13:08:08 2012 +0300
+++ b/bin/pvl.backup-snapshot	Thu May 24 13:48:04 2012 +0300
@@ -376,6 +376,8 @@
         enable          = False, 
         intervals       = [],
         rsync_options   = {},
+
+        # XXX: not implemented?
         exclude_from    = None
     ) :
         self.name = name
@@ -441,9 +443,10 @@
 
         # build rsync options
         opts = dict(self.rsync_options)
-
-        # rsync links absolute paths..
-        opts['link-dest'] = os.path.abspath(link_dest)
+        
+        if link_dest :
+            # rsync links absolute paths..
+            opts['link-dest'] = os.path.abspath(link_dest)
         
         # to tempdir
         log.debug("rsync %s -> %s", self.source, temp_path)