![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| performing cleanup when a job finishes | ChicagoBlues | Shell Programming and Scripting | 4 | 03-06-2008 09:41 AM |
| mailing myself at regular intervals... | timepassman | Shell Programming and Scripting | 4 | 08-21-2005 05:11 PM |
| Date Intervals | yongho | Shell Programming and Scripting | 7 | 07-29-2005 01:19 PM |
| How to perform Date Intervals? | yongho | Shell Programming and Scripting | 2 | 06-21-2005 08:02 AM |
| Performing a non-recursive find in Unix | christallott | UNIX for Advanced & Expert Users | 3 | 09-06-2002 06:13 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
performing a task at regular intervals
hi!
i m tryin to write a program that will perform a specific tasks after fixed interval of time.say every 1 min. i jus donno how to go abt it.. which functions to use and so on... i wud like to add that i am dont want to use crontab over here. ny lead is appreciated. thanx. Last edited by mridula; 11-13-2005 at 09:07 AM. |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
UNIX supports about 30 signals, each with a unique integer code. You can program the current process to react to a particular signal in one of these ways.
React according to the default, which is to terminate, do nothing, or possibly dump core Ignore the signal Execute a user-supplied signal handler function In addition, you can program the current process to block certain signals. Blocked signals are queued and only delivered if they are unblocked. If you want a reminder of a timeout you can set the SIGALRM signal to the current process. Write a signal handler for the same and perform your operations there. However there are two ways of implementing UNIX signal. SYSV and BSD style. The BSD style is more efficient. |
|
#3
|
||||
|
||||
|
If you are looking to write a loop, then you might want to look at the sleep call as well. As in:
Code:
while(1) {
do stuff..
..
..
sleep(60); /* here you will sleep for 60 sec and then wake up and go on to do the same stuff again*/
}
|
||||
| Google The UNIX and Linux Forums |