I need your help.


 
Thread Tools Search this Thread
Operating Systems Solaris I need your help.
# 1  
Old 09-07-2008
I need your help.

Dear All,

I need Your help....

we have a an out file that is updated from time to time ( every x seconds )... can we make a script to check if the file contains a spesific patteren.... if it does, we need to make an action like running another script.....

is this possible without makin cronjob to check wiehther the file contains the pattern or not ? I mean when the input file recieves "?????" do action.


Thanks so much for your help..
# 2  
Old 09-07-2008
Did you mean to check pattern in the entire file each time ?

<grep should do this>

Or, check for the existence of the pattern in every data segment that is updated in 'x' seconds.

<Save, the file pointer and grep for the update section only>
# 3  
Old 09-07-2008
Quote:
Originally Posted by yahyaaa
is this possible without makin cronjob ..
Yes, it is possible but what's wrong with cron jobs ?
# 4  
Old 09-07-2008
I know grep should do it.... but if I want to check the pattern every five seconds... I need to make a cronjob to run the grep command.... right ?
what Im asking is that if I can check it automatically once the file contains this pattern with out any cronjob...

once the file has the patteren..... do something...

I cant use cronjob becasue it's not allowed on our server Smilie
# 5  
Old 09-07-2008
Insted of every five seconds how about when it happens - see if
tail -f <filename>
meets your needs to keep getting newly added records.
# 6  
Old 09-07-2008
Quote:
what Im asking is that if I can check it automatically once the file contains this pattern with out any cronjob
Then you should be going for your own job, with an "always running script" to check for every 5 minutes or so
# 7  
Old 09-07-2008
Dear matrixmadhan

Honestly... this is what we are trying not to do.... we cant keep checking the file because this will take a lot of time.... we need somekind of alert when it happens... what do you suggest... ?

Thnaks a lot
Login or Register to Ask a Question

Previous Thread | Next Thread
Login or Register to Ask a Question