|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
I am new to the Unix world. I have to create a script that will run a command every five minutes or at a specified interval. Anyone have any suggestions. Thank you in advance.
|
|
#2
|
|||
|
|||
|
You can create a cron job. Cron jobs can be scheduled anytime, anyday of the year. You can get lots of stuff on cron jobs on google.
-Yogesh. |
|
#3
|
|||
|
|||
|
Code:
# five minutes in seconds
let sleeptime=60*5
while true
do
sleep $sleeptime
# execute a script or whatever here
done
|
|
#4
|
|||
|
|||
|
Hi Jim,
what does sleep do between activity? Is that a unix system call? Does it use a software interrupt? It doesn't poll does it? -Steven |
|
#5
|
|||
|
|||
|
The kernel sends SIGALARM to bring the process back to 'life'.
See alarm(). Meanwhile the process is not active, nor it it polling. sleep in a shell script is the same as calling the system routines alarm() and pause(). |
![]() |
| Viewing: Dev Shed Forums > Operating Systems > UNIX Help > Unix Script Emergency |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|