Parallel execution works, error checking due to using pipes and add_name

does not work correctly.
This commit is contained in:
Nico Schottelius 2006-01-13 16:37:22 +01:00
parent 9b36bff9a0
commit 79a52ea55f

View file

@ -170,9 +170,22 @@ i=0
while [ "$i" -lt "$no_shares" ]; do while [ "$i" -lt "$no_shares" ]; do
# #
# Standard locations # Get current share
# #
eval name=\$share_${i} eval name=\$share_${i}
i=$[$i+1]
#
# start ourself, if we want parallel execution
#
if [ "$PARALLEL" ]; then
$0 "$INTERVALL" "$name" &
continue
fi
#
# Standard locations
#
backup="$CSOURCES/$name" backup="$CSOURCES/$name"
c_source="$backup/source" c_source="$backup/source"
c_dest="$backup/destination" c_dest="$backup/destination"
@ -181,7 +194,6 @@ while [ "$i" -lt "$no_shares" ]; do
c_rsync_extra="$backup/rsync_options" c_rsync_extra="$backup/rsync_options"
stdecho "Beginning to backup this source ..." stdecho "Beginning to backup this source ..."
i=$[$i+1]
# #
# Standard configuration checks # Standard configuration checks
@ -299,24 +311,18 @@ while [ "$i" -lt "$no_shares" ]; do
# #
# the rsync part # the rsync part
# options stolen shameless from rsnapshot # options partly stolen from rsnapshot
# #
stdecho "Transferring files..." stdecho "Transferring files..."
# non parallel rsync -a $VERBOSE $RSYNC_EXTRA $EXCLUDE \
if [ -z "$PARALLEL" ]; then --delete --numeric-ids --relative --delete-excluded \
rsync -a $VERBOSE $RSYNC_EXTRA $EXCLUDE \ "$source" "$destination_dir" 2>&1; zurueck=$? | add_name
--delete --numeric-ids --relative --delete-excluded \
"$source" "$destination_dir" 2>&1 | add_name echo $zurueck
# parallel execution
else
(rsync -a $VERBOSE $RSYNC_EXTRA $EXCLUDE \
--delete --numeric-ids --relative --delete-excluded \
"$source" "$destination_dir" 2>&1 | add_name ) &
fi
if [ $? -ne 0 ]; then if [ "$zurueck" -ne 0 ]; then
errecho "rsync failed, backup may be broken (see rsync errors)" errecho "rsync failed, backup may be broken (see rsync errors)"
continue continue
fi fi