Pi-hole Gravity is the database that contains all the blocked domains, by default, this is set to update every Sunday between 3-5 am. You may want to update this database more frequently to ensure you have all the latest domains, especially ones the related to malware and phishing.
This guide is aimed at both standard and docker installations of Pi-hole.
To achieve this, cron will be used to schedule the task every day.
sudo crontab -e
Select option 1 (if promted)
Add one of the following lines
0 5 * * * sudo docker exec -it pihole_container_name pihole updateGravity >/dev/null 2>&1 - This will run every day at 5 am.
0 3 * * * sudo pihole updateGravity >/dev/null 2>&1 - This will run every day at 3 am.
Flush Pi-hole logs every day
0 0 * * * sudo docker exec -it pihole_container_name pihole flush >/dev/null 2>&1
0 0 * * * sudo pihole flush >/dev/null 2>&1
These will clear the logs every day at midnight.
Cover Image Credit: https://unsplash.com/photos/2YWS62tLATA