I have to write a script where I poll a txt file for data (30 min interval)
Dependent on the data read, the script should return a message.
It should look something like the "code" below:
--
do while <data recived>
sleep 30m
read data from file
Done
If <data> x return "A"
If <data> y return "B"
--
How do I write a a script solving this issue?
I believe that following are the issues in concern:
1. causing the process to wait/sleep for 30min
2. reading from the file
3. comparing the data received
4. showing the apt o/p
Since u need this process to run intermittently, atleast as it seems, I advise u to put it in a cron job.
If, u wish to use an infinite loop only or cannot use the cron for some reason, u must do this:
for 1 : sleep <number of secs> Eg:
causes a wait of 1 second
for 2,3,4: i dont think they should be a problem. If u have a prob in any of these please tell.
This not a joke but a quite serious question to maybe have your point of view about this very topic of content on the net. So I start this poll to ask the users if they can imagine that the so called content industry of former times sooner or later or anyway will regain lost ground or not? Do you... (1 Reply)
Hi Guys,
Please help me with my problem here:
I have a source file:
1212 23232 343434 ASAS1 4
3212 23232 343434 ASAS2 4
3234 23232 343434 QWQW1 4
1134 23232 343434 QWQW2 4
3212 23232 343434 QWQW3 4
and a mapping... (4 Replies)
Hi, guys:
I want to write my own shell using C. I am confused about the usage of I/O multiplex. Does anyone know some examples or explain it to me ?
Thanks so much (1 Reply)
Dear Experts,
I have a requirement where a 3rd party system places a file in my folder.I am running on HP UNIX. I would like to have a unix script which will check for the existence of the file. If yes OK. if the file is not placed then it has to send a mail to couple of emails ids saying that... (3 Replies)
Hi ,
i have a requirement in which i have to ftp files to unix from windows and vice versa.
I have to encrypt files in windows which will then be decrypted in unix and vice versa.
Now the process needs to be automated ..therefore when windows server or unix server recieves the files a shell... (5 Replies)
Hello,
Before I do a GET remote file, I need to ensure the remote file is a complete file i.e. whatever process is saving the file to the remote folder should complete the transfer before I go GET it through my script.
So I'm thinking I need to poll the remote file every minute or so to... (4 Replies)
Hi,
Off late I had been looking at the differences b/w select() & poll() system calls. The requirement is to reduce the overhead, processor power in waiting for the data. In the kind of connections under consideration there would be very frequent data arriving on the sockets, so poll() fares... (12 Replies)