![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| generating data for 1 hour | aajan | Shell Programming and Scripting | 0 | 03-17-2008 02:59 AM |
| help in hour grep | ali560045 | Shell Programming and Scripting | 0 | 01-31-2008 12:03 AM |
| an hour less in 24 hour system | bobo | UNIX for Dummies Questions & Answers | 3 | 10-23-2006 08:55 AM |
| find files older than 30mins,count and send mail | kayarsenal | Shell Programming and Scripting | 4 | 09-27-2006 11:11 AM |
| 1 Hour less | bobo | UNIX for Dummies Questions & Answers | 6 | 05-16-2006 09:07 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Run a script on the hour but only for 30mins
Hi All,
I want to run a script on the hour during a 24 - hour period; easy enough cron will take care of that..however I want the script to only run for only 30mins.. so with the script it knows its 30mins are up so exits. any ideas? Any help, greatly appericated. Thanking you all inadvance. |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
you can put the below lines as the first lines of your script..
#!/bin/sh echo $$ > /tmp/myprog.lck echo sleep 1800 > mytmp.sh echo kill -9 \`cat /tmp/myprog.lck\` >> mytmp.sh sh mytmp.sh & while true; do echo ilan; sleep 2; done #here your script content goes instead of while loop exit 0 this will terminate itself in 30 minutes... -ilan |
|
#3
|
|||
|
|||
|
You Sir are a genius !
|
|||
| Google The UNIX and Linux Forums |