I am a newbie to Pi-hole and apologize if my question has been yet discussed several times.
I am trying to understand what exactly the result of and the purpose behind the cron jobs in /etc/cron.d/pihole is?
In the topic "How often does Pi-hole update the ad lists?" the author states:
"... Please note that the Pi-hole software will not update itself; this just checks for updates to the ad source lists ..."
What is then the purpose and the benefit for the user of the cron jobs?
What happens if there are updates? How do I (i.e. the user) take notice of this and what action shall I take in order to update my ad sources?
I have configured following ad list into the adlist group management: https://v.firebog.net/hosts/lists.php?type=tick
This URL shows me in the browser a collection of URLs which point to text files containing the domains to be blocked. (this is my interpretation of the mechanism, corrections are welcome).
One of the URLs is, e.g. https://raw.githubusercontent.com/Spam404/lists/master/main-blacklist.txt. In the text, the domain megapolis-hack.com is contained. If this list is completed with megapolis-hack-NEW.com (just an example): will the respective cron job detect it and inform me to update the ad sources manually?
Thanx in advance for your answers, hints, explanations.
# Pi-hole: Update the ad sources once a week on Sunday at a random time in the
# early morning. Download any updates from the adlists
# Squash output to log, then splat the log to stdout on error to allow for
# standard crontab job error handling.
2 3 * * 7 root PATH="$PATH:/usr/sbin:/usr/local/bin/" pihole updateGravity >/var/log/pihole_updateGravity.log || cat /var/log/pihole_updateGravity.log
# Pi-hole: Flush the log daily at 00:00
# The flush script will use logrotate if available
# parameter "once": logrotate only once (default is twice)
# parameter "quiet": don't print messages
00 00 * * * root PATH="$PATH:/usr/sbin:/usr/local/bin/" pihole flush once quiet
@reboot root /usr/sbin/logrotate /etc/pihole/logrotate
# Pi-hole: Grab local version and branch every 10 minutes
*/10 * * * * root PATH="$PATH:/usr/sbin:/usr/local/bin/" pihole updatechecker local
# Pi-hole: Grab remote version every 24 hours
24 14 * * * root PATH="$PATH:/usr/sbin:/usr/local/bin/" pihole updatechecker remote
@reboot root PATH="$PATH:/usr/sbin:/usr/local/bin/" pihole updatechecker remote reboot
You will need to add the indivdual URL's to the adlists, and not use this URL. Copy and paste the lot of them into your adlists and rebuild gravity.
No, that's not the way a cron job works. When Pi-hole updates gravity, it checks each list for a change header. If the list has changed since last gravity update (or has no change header), then the entire list is downloaded and added to gravity. If the list is unchanged, Pi-hole uses a locally cached copy to avoid the demand on the list server to download an unchanged list.