Skip to content

Commit

Permalink
RESOLVED #32 regression, always transferring full snapshots
Browse files Browse the repository at this point in the history
UPDATED readme, version
  • Loading branch information
masc3d committed Jun 26, 2016
1 parent 8e54abc commit 80a74b3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion btrfs_sxbackup/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
9 changes: 9 additions & 0 deletions btrfs_sxbackup/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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))

Expand Down

0 comments on commit 80a74b3

Please sign in to comment.