Am not getting the e-mail with output from script (NIGHTLY-PROCESSING.s) run from cron. Suspect another script (LISTEN-PTS.s) started as background task from cron script is holding things up. It's as if the script started in background is holding up the cron script from finishing. If I manually stop the background script, then the cron script appears to terminate and I get the e-mail with output messages.
Does this make sense? Is it ok to start a script as a background task from within a script run from cron? Do I have to do something special to let the first script terminate normally after starting the background task?
Script started by cron (NIGHTLY-PROCESSING.s)
Background started script (LISTEN-PTS.s)
Code what you mean,
and mean what you code!
But by all means post your code!
Razalas
Does this make sense? Is it ok to start a script as a background task from within a script run from cron? Do I have to do something special to let the first script terminate normally after starting the background task?
Script started by cron (NIGHTLY-PROCESSING.s)
Code:
#
# Start "nightly processing" Cobol driver, SY-010
#
runcobol SY-010
#
# Send a copy of nightly tar backup to development server
#
if [ "$HOSTNAME" = "mgmt" ]
then
ftp -n -v 172.16.20.1 < FTP-NIGHTLY > FTP-BACKUP-LOG
fi
#
# Restart "Listener" scripts for Lucas Voice Systems results files
#
if [ -x LISTEN-PTS.s ]
then
./LISTEN-PTS.s &
fi
#
# End of NIGHTLY-PROCESSING.s
#
Background started script (LISTEN-PTS.s)
Code:
if [ -e PTS.log ]
then
echo "Picking Listener may already be in progress..."
echo "Please check existing PTS.log!"
echo "If no longer active, please remove PTS.log before restarting..."
else
echo "Initializing PTS.log..."
echo "Picking Results Queue Processing Log" > PTS.log
echo "Initialized: " `date +"%D %T"` >> PTS.log
echo "By: " `id` >> PTS.log
echo "On: " $HOSTNAME "PID #" $$ >> PTS.log
echo "Starting..."
while [[ -e PTS.log ]];
do
echo "Processing: " `date +"%D %T"` >> PTS.log
find voicedata -name "LUC*.PTS" -exec runcobol OE-001P -k -a "{}" \;
sleep $INTERVAL;
done;
fi;
Code what you mean,
and mean what you code!
But by all means post your code!
Razalas