Hi All,
Sorry to post these many questions on UNIX. i am new to unix & got only UNIX work in my organization.
I need to make a script for File Arrival Check.
- The script should wait for indicator file for configured amount of time.
- If the file is not received after the configured amount of time, it should check the table in oracle which has a filed "Next Feed Date". If a feed is not expected, then it should create necessary touch file & then exit from the process.
- If the feed is expected & still not received raise a FATAl error & continue to wait for the file.
- Once the feed is detected, wait until the file is transfer & then do feed validation (Feed validation script i have completed).
Could someone help me if this kind of script is handy...
Hi all,
Can someone help me on this requirement.. i really appreciate for this....
please don't "bump" up your posts, it's against the rules of unix.com!
also i think nobody is going to write a script for you. it's your work to write this script. just start it and see how far you can get and if you stumble upon a problem... you will find help. but YOU have to start the script!
thanks,
DN2
Hi DukeNuke,
I was not asking to write a script for me. I have asked to pass if someone has handy. Else couple of comand or hints which i can use for this requirement is enough
Main problem is i do not know unix much & even i do not know if there is any functionality exists in unix which we can use to make filewatcher script.
Thanks for your understanding.
Regards,
AS
Hi All,
I made the solution for this...
#!/bin/sh
datafile=$1
indfile=$2
waittime=100
starttime=0
while [ $starttime -le $waittime ]
do
if [ -f $indfile ]
then
do your process (ie run feed validation script)
exit 0
else
sleep 10;
starttime=`echo "$starttime + 10" | bc`
if [ $starttime -eq $waittime ]
then
echo "Waittime excceded"
Get_feed_date=`sqlplus -s amit/amit@amit <<END
set feedback off;
set heading off;
select to_char(fdnxtdt, 'YYYYMMDD') from amit where source_desc='$1';
exit;
END`
if [ $Get_feed_date -ne $timestamp ]
then
touch xxx.wit
exit 0
else
echo "File has not arrived yet; continue to wait !!"
starttime=0
fi
fi
fi
done