OPNsense Forum

Archive => 24.1, 24.4 Legacy Series => Topic started by: r.2024 on April 07, 2024, 06:32:14 PM

Title: Schedule a specific local time within Cron [solved]
Post by: r.2024 on April 07, 2024, 06:32:14 PM
is there some way to schedule cron jobs every night at 1am local for example?
Title: Re: Schedule a specific local time within Cron
Post by: Patrick M. Hausen on April 07, 2024, 06:41:43 PM
Of course. What exactly is the problem?
Title: Re: Schedule a specific local time within Cron
Post by: r.2024 on April 07, 2024, 07:19:15 PM
hi patrick, well i want to have my ids/ips rules and dnsbl rules update and restart at 1am for example.  i cant find a way to do that within the interface since the "hours" field wont even accept 24 as i'm currently thinking that the only way to have tried to do this was to wait until 1am tonight and then configure cron and hit save...just at a loss really
Title: Re: Schedule a specific local time within Cron
Post by: Patrick M. Hausen on April 07, 2024, 07:59:45 PM
Minutes: 0
Hours: 1
Rest: * * *

That's 1am local time every day. Cron runs on local time.
Title: Re: Schedule a specific local time within Cron
Post by: Patrick M. Hausen on April 07, 2024, 08:03:13 PM
Reading your post again ... the crontab entries specify a point in time, not an interval! You do not enter "every 24 hours" - you enter "at the hour 1"!

OMG! You completely misunderstood how that tool works.

Hope to have made it clear  ;)
Title: Re: Schedule a specific local time within Cron
Post by: chemlud on April 07, 2024, 08:14:04 PM
https://crontab.guru/
Title: Re: Schedule a specific local time within Cron
Post by: r.2024 on April 07, 2024, 08:49:49 PM
Quote from: Patrick M. Hausen on April 07, 2024, 08:03:13 PM
Reading your post again ... the crontab entries specify a point in time, not an interval! You do not enter "every 24 hours" - you enter "at the hour 1"!

OMG! You completely misunderstood how that tool works.

Hope to have made it clear  ;)

gah!  that makes much more sense...sory it really didnt seem explained well in the documentation.  really appreciate it Patrick!
Title: Re: Schedule a specific local time within Cron
Post by: r.2024 on April 07, 2024, 08:53:19 PM
Quote from: chemlud on April 07, 2024, 08:14:04 PM
https://crontab.guru/

thank chem, i never would've found that.  much appreciated