Change Gravity Update frequency from GUI

Hey Guys,

I think it would be great if we could choose the gravity list update frequency in the Web Admin panel. The lists seem to be updated every few hours, manually updating them is a pain.

Gravity is updated weekly on Sunday, between 3 am and 5 am your local time, at a random time installed as a cron script during install. The weekly interval is chosen with regard to overloading the blocklist servers, and considering the number of changes made to blacklists in a given week. Here is an example script that runs at 3:09 am local.

-rw-r--r-- 1 root root 1703 Sep 15 18:12 /etc/cron.d/pihole
   9 3   * * 7   root    PATH="$PATH:/usr/local/bin/" pihole updateGravity >/var/log/pihole_updateGravity.log || cat /var/log/pihole_updateGravity.log

If you change your blocklists from the web admin GUI, the "save and update" selection box updates gravity to incorporate your current set of lists.

Can we make this available in the interface? I understand that you don't want to overload servers but it makes pihole completely useless for those who use it as well to block bad domains (malware, phishing etc.) becase the lists are much more dynamic and the contents can change a lot from one day to another.

I know you can do you by editing cron but it make it hardder for everyone, please at least make it available in the interface with a min of 12 or 24 hours.

1 Like

I think this would be quite useful. Especially for blocking malware sites.

Honestly, just edit the cronjob.

Please give an option in the GUI to specify how often and when the ad lists are updated.

Thanks for the amazing little software!

1 Like

For now, you can edit the cron job at /etc/cron.d/pihole

1 Like

is there a way to make the change permanent trough editing the cron job at this location is going to be overwritting according to the doc best thing you could probably do is just create an entirely new job that updates in parallel and well on sunday does it twice since the job in that file will just get recreated next time you update pihole anyway

You can create a different cron job that runs every day, except on Sunday:

0 4 * * 1-6 
1 Like

I ended up creating two cron jobs in a new file that update my lists every 12 hours now outside of the possible time range of the sunday update to make sure i don't accidentally get the gravity update script called twice possible before the first script even finished (i would imagine that could break stuff in the worst case scenario)