Skip to content

Commit

Permalink
RESOLVED #31 Error when destination has no snapshots
Browse files Browse the repository at this point in the history
UPDATED readme, version
  • Loading branch information
masc3d committed Jun 16, 2016
1 parent 7703484 commit 8e54abc
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
4 changes: 4 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,10 @@ transfer
Changelog
=========

0.6.8
-----
* RESOLVED #31 Error when destination has no snapshots

0.6.7
-----
* FIXED #30: full snapshot warning breaks local jobs (having no destination)
Expand Down
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.7'
__version__ = '0.6.8'
__author__ = 'Marco Schindler'
__email__ = 'masc@disappear.de'
__maintainer__ = 'masc@disappear.de'
Expand Down
16 changes: 10 additions & 6 deletions btrfs_sxbackup/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -967,12 +967,16 @@ def run(self):
source_parent_path = None
if len(self.source.snapshots) > 0:
# Latest source and destination snapshot timestamp has to match for incremental transfer
if self.destination is not None \
and self.source.snapshots[0].name.timestamp != self.destination.snapshots[0].name.timestamp:
_logger.warn(
('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))
if self.destination is not None:
if len(self.destination.snapshots) > 0:
if self.source.snapshots[0].name.timestamp != self.destination.snapshots[0].name.timestamp:
_logger.warn(
('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:
_logger.warn('Destination has no snapshots, a full snapshot will be transferred')

else:
source_parent_path = os.path.join(self.source.container_subvolume_path,
str(self.source.snapshots[0].name))
Expand Down

0 comments on commit 8e54abc

Please sign in to comment.