# * 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
# 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"
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
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
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
# 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
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
# 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