Customise randomised cronjob interval


I love Pi-hole, thank you all for the hard work!

I've tried to get some help on Discord, but I didn't get a reply for a while: Discord

I'd like to customise the random time interval for certain jobs, let's say the weekly upgrade, I would like to define an interval, eg. day: 6-7 (Sat or Sun), hours: 4-8 (AM), minutes don't matter, so 0-59. That's why on upgrade/install, the Pi-hole installer would only choose from this interval. Same for all the 4 cronjobs, per job config would be the best. Eg. with a config file or so. Is this something you can implement?

Connected to this: Randomize time of cron's PiHole -g process for getting all files

Thank you!

The link you posted was closed in 2017 after implementing the randomization:

The current code sets a random time between 3:00 and 5:00am for gravity and between 12:00pm and 8:00pm for Pi-hole updates.

if you are referring to the update of gravity done once a week, Pi-hole already does this at a random time on Sunday between 0300 and 0500 your local time.

This is done by the following code in the installer:

What is the goal in changing the time for log rotation, as an example? Logs are typically rotated at a meaningful time (i.e. the end of a day), so you can be certain that a log contains only the data for that day.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.