Re: Automatic notification to application based on system date and time (Monta-vista linux)



On a sunny day (Thu, 28 Sep 2006 13:41:15 GMT) it happened Bill Medland
<billmedland@xxxxxxx> wrote in <%hQSg.68686$R63.46986@pd7urf1no>:

Jan Panteltje wrote:

On a sunny day (28 Sep 2006 03:53:15 -0700) it happened "dadu"
<amol.bhopale@xxxxxxxxx> wrote in
<1159440795.332584.175310@xxxxxxxxxxxxxxxxxxxxxxxxxxx>:

Hello guys,

I need OS support in my application to receive signal or event from OS
when I configure it for particular date and time. In short, I am
expecting OS notification in my application on particular date and
time. Can anybody please help me on, how to implement this on linux?



Cheers,
Dadu.

I am not 100% sure, but I think there is no OS function for that.

Your program could poll getdate() every second, and compare year, month,
monthday, hour, minute and second to your 'setpoint'.

You can also use crontab to start a program, but I think crontab does not
care about years.
Not that I really know but wouldn't the "normal" way be to decide on a
signal, put the program's pid in a file in /var and have cron schecdule a
kill call with that signal to that pid?

Polling getdate() once a second is not a big system load.


man 5 crontab says that yo ucan only specify:
# m h dom mon dow user command
42 6 * * * root run-parts --report /etc/cron.daily
etc.
So if your date is April 1 2008, and you specify April for month,
than it will also trigger in 2007.

I had a TV recording program start unexpectedly that was still in crontab
from last year :-)
Using gettimeofday will use seconds since (whatever), and works nice for
my TV timer, until 2036?.

If I start
.



Relevant Pages

  • Re: Automatic notification to application based on system date and time (Monta-vista linux)
    ... I need OS support in my application to receive signal or event from OS ... Your program could poll getdate() every second, and compare year, month, ... You can also use crontab to start a program, but I think crontab does not ... kill call with that signal to that pid? ...
    (comp.os.linux.development.apps)
  • Re: Suses crontab format
    ... > |The man pages for crontab and cron don't explain Suse's crontab ... that depends on /which/ standard you go by. ... and day of month fields will specify the days that match. ... A percent sign character in this field will be ...
    (alt.os.linux.suse)
  • Re: cron on 10.5.2 server
    ... Modify your own .vimrc to specify your own nowritebackup ... autocmd BufReadPre,FileReadPre crontab.* set nowritebackup ... I did NOT specify a directory path. ... crontab.* is treated this way. ...
    (comp.sys.mac.misc)
  • Re: cron on 10.5.2 server
    ... Modify your own .vimrc to specify your own nowritebackup ... autocmd BufReadPre,FileReadPre crontab.* set nowritebackup ... I did NOT specify a directory path. ... crontab.* is treated this way. ...
    (comp.sys.mac.misc)
  • Re: cron on 10.5.2 server
    ... Modify your own .vimrc to specify your own nowritebackup ... autocmd BufReadPre,FileReadPre crontab.* set nowritebackup ... I did NOT specify a directory path. ... crontab.* is treated this way. ...
    (comp.sys.mac.misc)