ControlScripts: replace &>> contruct with >> ... 2>&1 in run_campaign.sh and run_scen...
authorP2P-Next User <p2p@p2p-next-04-201.grid.pub.ro>
Wed, 18 Aug 2010 15:20:14 +0000 (15:20 +0000)
committerRazvan Deaconescu <razvan.deaconescu@cs.pub.ro>
Mon, 20 Sep 2010 16:01:11 +0000 (18:01 +0200)
ControlScripts/run_campaign.sh
ControlScripts/run_scenario.sh

index d0cbbfa..b3154d8 100755 (executable)
@@ -101,7 +101,7 @@ while IFS=$'\t' read SCENARIO_FILE PLOT_SCRIPT; do
        # * the path to the folder where the data files are stored, and where the graph will be saved
        # * the name (with the id) of the campaign
        SCENARIO_NAME=${SCENARIO_FILE%\.*}
-       Rscript $CONFIG_FILES_REL_PATH/$PLOT_SCRIPT --args $CAMPAIGN_RESULTS_FOLDER/$SCENARIO_NAME $CAMPAIGN_NAME &>> $ERR_LOG
+       Rscript $CONFIG_FILES_REL_PATH/$PLOT_SCRIPT --args $CAMPAIGN_RESULTS_FOLDER/$SCENARIO_NAME $CAMPAIGN_NAME >> $ERR_LOG 2>&1
        echo "done"
        
        # reutrn to the initial current working directory
@@ -117,12 +117,12 @@ unset IFS
 
 # Creating the HTML file in the results folder
 echo -n "Copying the HTML file to results folder..."
-cp $CONFIG_FILES_REL_PATH/${CAMPAIGN_FILE%\.*}.html $CAMPAIGN_RESULTS_FOLDER/index.html &>> $ERR_LOG
+cp $CONFIG_FILES_REL_PATH/${CAMPAIGN_FILE%\.*}.html $CAMPAIGN_RESULTS_FOLDER/index.html >> $ERR_LOG 2>&1
 echo "done"
 
 
 
 # Publishing results to swarm
 echo -n "Publishing results to swarm.cs.pub.ro..."
-rsync -avP --exclude OldResults ${RESULTS_FOLDER_REL_PATH}/ george@swarm.cs.pub.ro:public_html/p2p-next/proxy-service-tests/ &>> $ERR_LOG
+rsync -avP --exclude OldResults ${RESULTS_FOLDER_REL_PATH}/ george@swarm.cs.pub.ro:public_html/p2p-next/proxy-service-tests/ >> $ERR_LOG 2>&1
 echo "done"
index 6e43d11..9dbcf6a 100755 (executable)
@@ -101,7 +101,7 @@ scenario_setup() {
                echo " ** Setting-up $SERVER:$PORT"
 
                # Clean-up the host by using rsync
-               if ! rsync -avP --del --exclude 'Results' --rsh='ssh -p'$PORT $TEST_INFRASTRUCTURE_REL_PATH ${USER}@${SERVER}:${REMOTE_PATH} &>> $ERR_LOG; then
+               if ! rsync -avP --del --exclude 'Results' --rsh='ssh -p'$PORT $TEST_INFRASTRUCTURE_REL_PATH ${USER}@${SERVER}:${REMOTE_PATH} >> $ERR_LOG 2>&1; then
                        echo "Error: rsync error on $SERVER"
                        exit 1
                fi
@@ -125,14 +125,14 @@ CLIENT_TYPE=\"${CLIENT_TYPE}\"
 TORRENT_FILE=\"${TORRENT_FILE}\"
 PERIODS=\"${PERIODS}\"
 END
-" &>> ${ERR_LOG}; then
+" >> ${ERR_LOG} 2>&1; then
                        echo "Error: cannot create scenario config file"
                        exit 1
                fi
 
                # run pre-run script
                # -n is used to redirect the ssh stdin from /dev/null, in order to keep the stdin in place for the read command
-               if ! ssh -n -p $PORT ${USER}@${SERVER} "cd $REMOTE_PATH/P2P-Testing-Infrastructure/ControlScripts; ./${PRE_RUN_SCRIPT}" &>> $ERR_LOG; then
+               if ! ssh -n -p $PORT ${USER}@${SERVER} "cd $REMOTE_PATH/P2P-Testing-Infrastructure/ControlScripts; ./${PRE_RUN_SCRIPT}" >> $ERR_LOG 2>&1; then
                        echo "Error: tc error setting limitations on $SERVER"
                        exit 1
                fi
@@ -147,7 +147,7 @@ scenario_schedule()
        echo "---------------------- scenario_schedule" >> $ERR_LOG
        while IFS=$'\t' read SERVER PORT USER REMOTE_PATH REMOTE_IF DL_BW DL_BURST UL_BW UL_BURST NO_CONNECTIONS PRE_RUN_SCRIPT POST_RUN_SCRIPT CLIENT_TYPE TORRENT_FILE PERIODS; do
                echo " ** Scheduling $SERVER:$PORT"
-               if ! ssh -f -p $PORT ${USER}@${SERVER} "cd $REMOTE_PATH/P2P-Testing-Infrastructure/ControlScripts; ./schedule_client.sh &> $REMOTE_PATH/P2P-Testing-Infrastructure/ClientWorkingFolders/TmpLogs/\$(hostname).log" &>> $ERR_LOG; then
+               if ! ssh -f -p $PORT ${USER}@${SERVER} "cd $REMOTE_PATH/P2P-Testing-Infrastructure/ControlScripts; ./schedule_client.sh &> $REMOTE_PATH/P2P-Testing-Infrastructure/ClientWorkingFolders/TmpLogs/\$(hostname).log" >> $ERR_LOG 2>&1; then
                        echo "Error: error running client_schedule.sh on $SERVER"
                        break
                fi
@@ -170,7 +170,7 @@ scenario_wait() {
                # Start the scripts on the remote clients
                # -n is used to redirect the ssh stdin from /dev/null, in order to keep the stdin in place for the read command
                # The ssh call is blocking
-               if ! ssh -n -p $PORT ${USER}@${SERVER} "cd $REMOTE_PATH/P2P-Testing-Infrastructure/ControlScripts; ./detect_complete_client.sh $REMOTE_PATH/P2P-Testing-Infrastructure/ClientWorkingFolders/TmpLogs/\$(hostname).log" &>> $ERR_LOG; then
+               if ! ssh -n -p $PORT ${USER}@${SERVER} "cd $REMOTE_PATH/P2P-Testing-Infrastructure/ControlScripts; ./detect_complete_client.sh $REMOTE_PATH/P2P-Testing-Infrastructure/ClientWorkingFolders/TmpLogs/\$(hostname).log" >> $ERR_LOG 2>&1; then
                        echo "Error: error while waiting for client on $SERVER to finish"
                        break
                fi
@@ -205,14 +205,14 @@ CLIENT_TYPE=\"${CLIENT_TYPE}\"
 TORRENT_FILE=\"${TORRENT_FILE}\"
 PERIODS=\"${PERIODS}\"
 END
-" &>> ${ERR_LOG}; then
+" >> ${ERR_LOG} 2>&1; then
                        echo "Error: cannot create scenario config file"
                        exit 1
                fi
 
                # stopping the client on the server
                # -n is used to redirect the ssh stdin from /dev/null, in order to keep the stdin in place for the read command
-               if ! ssh -n -p $PORT ${USER}@${SERVER} "cd $REMOTE_PATH/P2P-Testing-Infrastructure/ControlScripts; ./stop_client.sh" &>> $ERR_LOG; then
+               if ! ssh -n -p $PORT ${USER}@${SERVER} "cd $REMOTE_PATH/P2P-Testing-Infrastructure/ControlScripts; ./stop_client.sh" >> $ERR_LOG 2>&1; then
                        echo "Error: error stopping client on $SERVER"
                fi
                # wait for the remote client to finish completly
@@ -220,20 +220,20 @@ END
 
                # run post-run script
                # -n is used to redirect the ssh stdin from /dev/null, in order to keep the stdin in place for the read command
-               if ! ssh -n -p $PORT ${USER}@${SERVER} "cd $REMOTE_PATH/P2P-Testing-Infrastructure/ControlScripts; ./${POST_RUN_SCRIPT}" &>> $ERR_LOG; then
+               if ! ssh -n -p $PORT ${USER}@${SERVER} "cd $REMOTE_PATH/P2P-Testing-Infrastructure/ControlScripts; ./${POST_RUN_SCRIPT}" >> $ERR_LOG 2>&1; then
                        echo "Error: tc error deleting limitations on $SERVER"
                fi
 
                # Remove node config file
-               if ! ssh -n -p ${PORT} ${USER}@${SERVER} "rm $REMOTE_PATH/P2P-Testing-Infrastructure/ClientWorkingFolders/TmpLogs/node_config" &>> ${ERR_LOG}; then
+               if ! ssh -n -p ${PORT} ${USER}@${SERVER} "rm $REMOTE_PATH/P2P-Testing-Infrastructure/ClientWorkingFolders/TmpLogs/node_config" >> ${ERR_LOG} 2>&1; then
                        echo "Error: cannot remove node_config file"
                fi
 
                # Retrieve log files
-               scp -P $PORT ${USER}@${SERVER}:${REMOTE_PATH}/P2P-Testing-Infrastructure/ClientWorkingFolders/TmpLogs/* $SCENARIO_RESULTS_FOLDER &>> $ERR_LOG
+               scp -P $PORT ${USER}@${SERVER}:${REMOTE_PATH}/P2P-Testing-Infrastructure/ClientWorkingFolders/TmpLogs/* $SCENARIO_RESULTS_FOLDER >> $ERR_LOG 2>&1
 
                # Clean-up the host by using rsync
-               if ! rsync -avP --del --exclude 'Results' --rsh='ssh -p'$PORT $TEST_INFRASTRUCTURE_REL_PATH ${USER}@${SERVER}:${REMOTE_PATH} &>> $ERR_LOG; then
+               if ! rsync -avP --del --exclude 'Results' --rsh='ssh -p'$PORT $TEST_INFRASTRUCTURE_REL_PATH ${USER}@${SERVER}:${REMOTE_PATH} >> $ERR_LOG 2>&1; then
                        echo "Error: rsync error on $SERVER"
                fi
        done < $TMP_FILE