[Rear-users] SF.net SVN: rear:[668] trunk/usr/share/rear/restore/RSYNC/default/ 40_restore_rsync_backup.sh

gdha at users.sourceforge.net gdha at users.sourceforge.net
Thu Jul 7 17:29:50 CEST 2011


Revision: 668
          http://rear.svn.sourceforge.net/rear/?rev=668&view=rev
Author:   gdha
Date:     2011-07-07 15:29:50 +0000 (Thu, 07 Jul 2011)

Log Message:
-----------
rsync output is written in log file before it is actually restored, so the getsize function cannot find the file

Modified Paths:
--------------
    trunk/usr/share/rear/restore/RSYNC/default/40_restore_rsync_backup.sh

Modified: trunk/usr/share/rear/restore/RSYNC/default/40_restore_rsync_backup.sh
===================================================================
--- trunk/usr/share/rear/restore/RSYNC/default/40_restore_rsync_backup.sh	2011-07-07 15:26:05 UTC (rev 667)
+++ trunk/usr/share/rear/restore/RSYNC/default/40_restore_rsync_backup.sh	2011-07-07 15:29:50 UTC (rev 668)
@@ -18,6 +18,7 @@
 			case $RSYNC_PROTO in
 
 				(ssh)
+					Log $BACKUP_PROG "${RSYNC_OPTIONS[@]}" "${RSYNC_USER}@${RSYNC_HOST}:${RSYNC_PATH}/${RSYNC_PREFIX}/backup"/ /mnt/local/
 					$BACKUP_PROG "${RSYNC_OPTIONS[@]}" \
 					"${RSYNC_USER}@${RSYNC_HOST}:${RSYNC_PATH}/${RSYNC_PREFIX}/backup"/ \
 					/mnt/local/
@@ -41,21 +42,23 @@
 BackupPID=$!
 starttime=$SECONDS
 
-sleep 1 # Give the backup software a good chance to start working
+sleep 3 # Give the backup software a good chance to start working
 
 # make sure that we don't fall for an old size info
 unset size
 # while the restore runs in a sub-process, display some progress information to the user
 case "$(basename $BACKUP_PROG)" in
 	(rsync)
+		
 		while sleep 1 ; kill -0 $BackupPID 2>/dev/null ; do
-			fsize="$(get_size $(tail -1 "${BUILD_DIR}/${BACKUP_PROG_ARCHIVE}-restore.log"))"
+			fsize="$(get_size $(tail -2 "${BUILD_DIR}/${BACKUP_PROG_ARCHIVE}-restore.log" | head -n 1))"
 			size=$((size+fsize))
 			echo "INFO Restored $((size/1024/1024)) MiB [avg $((size/1024/(SECONDS-starttime))) KiB/sec]" >&8
 		done
 		;;
 
 	(*)
+
 		echo "INFO Restoring" >&8
 		while sleep 1 ; kill -0 $BackupPID 2>/dev/null ; do
 			ProgressStep


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the rear-users mailing list