Hi,
I have a script that finds the application logs from the previous day and sends it to another server via ftp.
The code is something like this:
yest_date=`TZ=CST+24 date "+%b %d"`
logdir=/app/logs
logs=app*.log
tmpdir=/tmp
cd $logdir
for i in `ls -1 $logs`
do
chkstr=`ls -1l $i | grep "$yest_date"
if [ "$chkstr" != "" ]
then
tar -cvf $tmp/$yest_date-logs.tar $file
The script works fine when ran manually and via cron. But when ran through a job scheduler, UC4, the script fails every 15th - 20th of the month! Consistently! It looks like from the script log, the code just did not execute. The log shows that it cannot find the .tar file when it attempted to ftp.
My OS is AIX and shell is Korn shell. The job scheduler uses the same login as when I execute the script manually or when ran thru cron. The AIX admins found no processes/jobs that could affect the script execution. What else could I check? Any ideas is much appreciated!