Merge lp:~bratdaking/backintime/bug-412470 into lp:backintime/1.0

Proposed by Bart de Koning
Status: Merged
Merged at revision: not available
Proposed branch: lp:~bratdaking/backintime/bug-412470
Merge into: lp:backintime/1.0
Diff against target: 115 lines
2 files modified
CHANGES (+1/-0)
common/snapshots.py (+43/-38)
To merge this branch: bzr merge lp:~bratdaking/backintime/bug-412470
Reviewer Review Type Date Requested Status
Back In Time Team Pending
Review via email: mp+13381@code.launchpad.net
To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'CHANGES'
--- CHANGES 2009-05-27 14:52:37 +0000
+++ CHANGES 2009-10-14 20:45:20 +0000
@@ -5,6 +5,7 @@
5* multiple profiles support5* multiple profiles support
6* GNOME: fix notification6* GNOME: fix notification
7* fix small bugs7* fix small bugs
8* Fix bug in schedule per included folder (LP: #412470)
89
9Version 0.9.2610Version 0.9.26
10* update translations from Launchpad11* update translations from Launchpad
1112
=== modified file 'common/snapshots.py'
--- common/snapshots.py 2009-05-14 13:27:37 +0000
+++ common/snapshots.py 2009-10-14 20:45:20 +0000
@@ -652,23 +652,27 @@
652 self.set_take_snapshot_message( 0, _('Create hard-links') )652 self.set_take_snapshot_message( 0, _('Create hard-links') )
653 logger.info( "Create hard-links" )653 logger.info( "Create hard-links" )
654 654
655 if force or len( ignore_folders ) == 0:655 # When schedule per included folders is enabled this did not work (cp -alb iso cp -al?)
656 cmd = "cp -al \"%s\"* \"%s\"" % ( self.get_snapshot_path_to( prev_snapshot_id ), new_snapshot_path_to )656 # This resulted in a complete rsync for the whole snapshot consuming time and space
657 self._execute( cmd )657 # The ignored folders were copied afterwards. To solve this, the whole last snapshot is now hardlinked
658 else:658 # and rsync is called only for the folders that should be synced (without --delete-excluded).
659 for folder in include_folders:659 #if force or len( ignore_folders ) == 0:
660 prev_path = self.get_snapshot_path_to( prev_snapshot_id, folder )660 cmd = "cp -al \"%s\"* \"%s\"" % ( self.get_snapshot_path_to( prev_snapshot_id ), new_snapshot_path_to )
661 new_path = self.get_snapshot_path_to( new_snapshot_id, folder )661 self._execute( cmd )
662 tools.make_dirs( new_path )662 #else:
663 cmd = "cp -alb \"%s\"* \"%s\"" % ( prev_path, new_path )663 # for folder in include_folders:
664 self._execute( cmd )664 # prev_path = self.get_snapshot_path_to( prev_snapshot_id, folder )
665 # new_path = self.get_snapshot_path_to( new_snapshot_id, folder )
666 # tools.make_dirs( new_path )
667 # cmd = "cp -alb \"%s\"* \"%s\"" % ( prev_path, new_path )
668 # self._execute( cmd )
665 else:669 else:
666 if not self._create_directory( new_snapshot_path_to ):670 if not self._create_directory( new_snapshot_path_to ):
667 return False671 return False
668672
669 #sync changed folders673 #sync changed folders
670 logger.info( "Call rsync to take the snapshot" )674 logger.info( "Call rsync to take the snapshot" )
671 cmd = rsync_prefix + ' -v --delete-excluded ' + rsync_suffix + '"' + new_snapshot_path_to + '"'675 cmd = rsync_prefix + ' -v ' + rsync_suffix + '"' + new_snapshot_path_to + '"' # do not delete the excluded, as we will miss the hardlinks with files or folders that are scheduled for a later time
672 self.set_take_snapshot_message( 0, _('Take snapshot') )676 self.set_take_snapshot_message( 0, _('Take snapshot') )
673 self._execute( cmd, self._exec_rsync_callback )677 self._execute( cmd, self._exec_rsync_callback )
674678
@@ -687,33 +691,34 @@
687 fileinfo_dict[item_path] = 1691 fileinfo_dict[item_path] = 1
688 self._save_path_info( fileinfo, item_path )692 self._save_path_info( fileinfo, item_path )
689693
690 #copy ignored folders694 # We now copy on forehand, so copying afterwards is not necessary anymore
691 if not force and len( prev_snapshot_id ) > 0 and len( ignore_folders ) > 0:695 ##copy ignored folders
692 prev_fileinfo_dict = self.load_fileinfo_dict( prev_snapshot_id )696 #if not force and len( prev_snapshot_id ) > 0 and len( ignore_folders ) > 0:
693697 # prev_fileinfo_dict = self.load_fileinfo_dict( prev_snapshot_id )
694 for folder in ignore_folders:698 #
695 prev_path = self.get_snapshot_path_to( prev_snapshot_id, folder )699 # for folder in ignore_folders:
696 new_path = self.get_snapshot_path_to( new_snapshot_id, folder )700 # prev_path = self.get_snapshot_path_to( prev_snapshot_id, folder )
697 tools.make_dirs( new_path )701 # new_path = self.get_snapshot_path_to( new_snapshot_id, folder )
698 cmd = "cp -alb \"%s/\"* \"%s\"" % ( prev_path, new_path )702 # tools.make_dirs( new_path )
699 self._execute( cmd )703 # cmd = "cp -alb \"%s/\"* \"%s\"" % ( prev_path, new_path )
700 704 # self._execute( cmd )
701 if len( prev_fileinfo_dict ) > 0:705 #
702 #save permissions for all items to folder706 # if len( prev_fileinfo_dict ) > 0:
703 item_path = '/'707 # #save permissions for all items to folder
704 prev_path_items = folder.strip( '/' ).split( '/' )708 # item_path = '/'
705 for item in items:709 # prev_path_items = folder.strip( '/' ).split( '/' )
706 item_path = os.path.join( item_path, item )710 # for item in items:
707 if item_path not in fileinfo_dict and item_path in prev_fileinfo_dict:711 # item_path = os.path.join( item_path, item )
708 self._save_path_info_line( fileinfo, item_path, prev_fileinfo_dict[item_path] )712 # if item_path not in fileinfo_dict and item_path in prev_fileinfo_dict:
709713 # self._save_path_info_line( fileinfo, item_path, prev_fileinfo_dict[item_path] )
710 #save permission for all items in folder714
711 for path, dirs, files in os.walk( new_path ):715 # #save permission for all items in folder
712 dirs.extend( files )716 # for path, dirs, files in os.walk( new_path ):
713 for item in dirs:717 # dirs.extend( files )
714 item_path = os.path.join( path, item )[ len( path_to_explore ) : ]718 # for item in dirs:
715 if item_path not in fileinfo_dict and item_path in prev_fileinfo_dict:719 # item_path = os.path.join( path, item )[ len( path_to_explore ) : ]
716 self._save_path_info_line( fileinfo, item_path, prev_fileinfo_dict[item_path] )720 # if item_path not in fileinfo_dict and item_path in prev_fileinfo_dict:
721 # self._save_path_info_line( fileinfo, item_path, prev_fileinfo_dict[item_path] )
717722
718 fileinfo.close()723 fileinfo.close()
719724

Subscribers

People subscribed via source and target branches