Hi guys,
I've run into a bit of a problem here, I've got this script that runs db2diag on the various instances on the server, it works like a charm when I execute it locally, but when I execute it remotely via our scheduler it seems something is missing. The script runs fine without any errors (that I can see) with the only downside that db2diag doesn't generate anything, just empty logs.
Code:
function check_error
{
if [ "$VERBOSE_LOGGING" = 'high' ]; then
set -vx
fi
db2diag -time $TIME1 -l Error|egrep -v -p -f db2.exclude>$f1
if [ -s "$f1" ]; then
/usr/bin/mail -s "New errors in $db2inst on $HOST" $db2diagmail < $f1
else
echo $TIME1 > ${db2inst}/time.error
fi
}
Result is the same if I 2>&1 to a logfile instead of egrepping.
Could it be the environment not being properly set even though .profile is executed earlier in the script?
Have any of you guys experienced the same or a similar issue, or got any clues about what might be causing this?