From 80a74b34a6448164cb739033249b079bbae00f46 Mon Sep 17 00:00:00 2001 From: masc3d Date: Sun, 26 Jun 2016 16:22:51 +0200 Subject: [PATCH] RESOLVED #32 regression, always transferring full snapshots UPDATED readme, version --- btrfs_sxbackup/__init__.py | 2 +- btrfs_sxbackup/core.py | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/btrfs_sxbackup/__init__.py b/btrfs_sxbackup/__init__.py index 72622b0..4701e56 100644 --- a/btrfs_sxbackup/__init__.py +++ b/btrfs_sxbackup/__init__.py @@ -5,7 +5,7 @@ # Software Foundation; either version 2 of the License, or (at your option) # any later version. -__version__ = '0.6.8' +__version__ = '0.6.9' __author__ = 'Marco Schindler' __email__ = 'masc@disappear.de' __maintainer__ = 'masc@disappear.de' diff --git a/btrfs_sxbackup/core.py b/btrfs_sxbackup/core.py index 8d0f8b3..a35f344 100644 --- a/btrfs_sxbackup/core.py +++ b/btrfs_sxbackup/core.py @@ -966,6 +966,9 @@ def run(self): # btrfs send command/subprocess source_parent_path = None if len(self.source.snapshots) > 0: + # Indicates if an incremental snapshot can/should be performed + incremental = False + # Latest source and destination snapshot timestamp has to match for incremental transfer if self.destination is not None: if len(self.destination.snapshots) > 0: @@ -974,10 +977,16 @@ def run(self): ('Latest timestamps of source [%s] and destination [%s] do not match. A full snapshot will ' 'be transferred') % (self.source.snapshots[0].name.timestamp, self.destination.snapshots[0].name.timestamp)) + else: + incremental = True else: _logger.warn('Destination has no snapshots, a full snapshot will be transferred') else: + incremental = True + + # Set source parent path in case incremental transfer is applicable + if incremental: source_parent_path = os.path.join(self.source.container_subvolume_path, str(self.source.snapshots[0].name))