ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Baz" <ba...@goodconsultants.com>
Subject Help with some shell script and ssh command problems...
Date Tue, 12 Apr 2005 15:37:33 GMT
Hi all,

I know this might be a little off the topic but i know this group can help 
me with my questions.

I am trying to execute a ssh command from a shell script. When execute, this 
script build.sh fine if i do: ./build.sh

However, if i do: ./build.sh > logfile 2>&1 ,the ssh command will hang from 
time to time and i cannot figure out the reason. The same problem with using 
"exec > $LOG_FILE 2>&1" within the script to capture logs.

Please help before i hurt my head scratching :)

I attached a couple of functions that I used SSH command within the script 
and hope someone can help to identify the issue...

Thank you.

Barry

# ---------------- FUNCTIONS -----------------
#

stop_weblogic () {

echo
echo "INFO: START: stop_weblogic"
echo
echo
echo "INFO: Stopping the weblogic server in host $HOST..."
(ssh -q $HOST "cd $MODULE_BIN_DIR; ant stop_weblogic") &

echo
echo "INFO: COMPLETED: stop_weblogic"

sleep 10

}

build () {

echo
echo "INFO: START: build"

echo
echo "INFO: Creating build number."
echo
echo
(ssh -q $HOST "cd $MODULE_BIN_DIR; ant build_number")

echo
echo "INFO: DO ALL!."
echo
echo
(ssh -q $HOST "cd $MODULE_BIN_DIR; ant do_all")

echo
echo "INFO: Doing EJB."
echo
echo
(ssh -q $HOST "cd $MODULE_BIN_DIR; ant ejb_jars_uptodate")

echo
echo "INFO: COMPLETED: build"

}

# ----------------- MAIN ---------------------
#

exec > $LOG_FILE 2>&1

echo
echo "INFO: START: `date`"

notify_start;
stop_weblogic;
#get_latest;
pre_build;
#build;
post_build;
start_weblogic;
check_if_wl_server_started;
checkbuild.sh $LOG_FILE
notify_complete;

echo
echo "INFO: END: `date`"

--------------------------------------------
My mailbox is spam-free with ChoiceMail, the leader in personal and corporate anti-spam solutions.
Download your free copy of ChoiceMail from www.choicemailfree.com

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message