The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > High Level Programming
Google UNIX.COM


High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
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

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1  
Old 11-13-2005
Registered User
 

Join Date: Sep 2005
Posts: 20
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.
Reply With Quote
Forum Sponsor
  #2  
Old 11-14-2005
Registered User
 

Join Date: Nov 2005
Posts: 1
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.
Reply With Quote
  #3  
Old 11-14-2005
blowtorch's Avatar
Supporter
 
Join Date: Dec 2004
Location: Singapore
Posts: 2,326
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*/
}
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 06:12 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0