Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Continuous or timed?

by afoken (Chancellor)
on Dec 11, 2020 at 16:24 UTC ( [id://11125010]=note: print w/replies, xml ) Need Help??


in reply to Continuous or timed?

Create a cron job running around midnight or high noon, have that job calculate sunrise and sunset and submit them to the cron system.

Depending on your cron implementation, it may be sufficient to create a file in a specific directory containing the two times and the open and close commands. Other cron implementations may need to run a command like crontab to submit such a file.

Alexander

--
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)

Replies are listed 'Best First'.
Re^2: Continuous or timed?
by Bod (Parson) on Dec 11, 2020 at 16:36 UTC

    Create a cron job running around midnight or high noon, have that job calculate sunrise and sunset and submit them to the cron system.

    That seems a very sensible approach and certainly one I would adopt if higher accuracy were needed. I like that is gets kicked off daily so is immune to the script failing.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11125010]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (3)
As of 2024-04-19 19:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found