# Cronjob

**URL:** <https://discourse.pi-hole.net/t/cronjob/15446>\
**Category:** General\
**Created:** [December 25, 2018, 12:06pm UTC](https://discourse.pi-hole.net/t/cronjob/15446 "2018-12-25T12:06:09Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![max\_bachmann](https://discourse-cdn.pi-hole.net/letter_avatar_proxy/v4/letter/m/a9adbd/32.png) [@max\_bachmann](https://discourse.pi-hole.net/u/max_bachmann)\
**Post date:** [December 25, 2018, 12:06pm UTC](https://discourse.pi-hole.net/t/cronjob/15446/1 "2018-12-25T12:06:10Z")

</div>

I have a question aubout the default cronjob that comes with pihole

there is one command for gravity, the the log flush, one to grab the local version every 10 min and one to grab the remote version every 24h.  
I understand what the first two do, but not what the grab local version and grab remote version do.  
Thank you in advance  
Max

---

<div class="post-metadata">

**Author:** ![jpgpi250](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/jpgpi250/32/286_2.png) [@jpgpi250](https://discourse.pi-hole.net/u/jpgpi250)\
**Post date:** [December 25, 2018, 12:46pm UTC](https://discourse.pi-hole.net/t/cronjob/15446/2 "2018-12-25T12:46:26Z")

</div>

In `/etc/pihole`, you will find the following files:  
`GitHubVersions`  
`localbranches`  
`localversions`  
These files are used by the web interface to generate the message on the bottom, displaying the version information, and possibly, if an update is available. To avoid reading that information from the outside world, over and over again (whenever you change or refresh a page), the information is retrieved by the cron jobs, stored in the local files, and used by the web interface to display the info.

---

<div class="post-metadata">

**Author:** ![max\_bachmann](https://discourse-cdn.pi-hole.net/letter_avatar_proxy/v4/letter/m/a9adbd/32.png) [@max\_bachmann](https://discourse.pi-hole.net/u/max_bachmann)\
**Post date:** [December 25, 2018, 1:01pm UTC](https://discourse.pi-hole.net/t/cronjob/15446/3 "2018-12-25T13:01:39Z")

</div>

and which part of the cronjob is for updating the pihole? on the internet I found that there should be a line updatePihole, but I couldn´t find it in the file commented out. So do I need to manually add the line?

---

<div class="post-metadata">

**Author:** ![jpgpi250](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/jpgpi250/32/286_2.png) [@jpgpi250](https://discourse.pi-hole.net/u/jpgpi250)\
**Post date:** [December 25, 2018, 1:14pm UTC](https://discourse.pi-hole.net/t/cronjob/15446/4 "2018-12-25T13:14:36Z")

</div>

In older versions of pihole, there used to be a cron job for `pihole -up`. After some really problematic udates, the developers removed this, encouraging users to update manually. A lot of users want to wait for a week or so, before taking that step.

Don't edit the pihole cron job, It will be overwritten by `pihole -up` or `pihole -r`

If you absolutely want to upgrade automatically (not recommended):  
You’ll need to add a cron job.

```auto
sudo nano /etc/cron.d/piholeupdate

```

content:

```auto
 # Pi-hole: Update Pi-hole
30 2 * * 7 root PATH="$PATH:/usr/local/bin/" pihole updatePihole

```

choose a valid time (example = 02h30) and day (example = sunday) or use `*` for any day

`edit`  
NOT even sure the latest versions of pihole will update unattended!!!  
`/edit`

---

<div class="post-metadata">

**Author:** ![max\_bachmann](https://discourse-cdn.pi-hole.net/letter_avatar_proxy/v4/letter/m/a9adbd/32.png) [@max\_bachmann](https://discourse.pi-hole.net/u/max_bachmann)\
**Post date:** [December 25, 2018, 1:49pm UTC](https://discourse.pi-hole.net/t/cronjob/15446/5 "2018-12-25T13:49:09Z")

</div>

ah that makes sence. I thought automatic updates might be a good thing since the pihole is in my parents home, but I guess it should be enough when I just do the updates when I visit them. However I guess I will give it a 6 months cronjob to update the root hints for unbound

and at least installing worked unattended using ansible for me and pihole -r aswell (did not test pihole -up)

---

<div class="post-metadata">

**Author:** ![jfb](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/jfb/32/4332_2.png) [@jfb](https://discourse.pi-hole.net/u/jfb)\
**Post date:** [December 25, 2018, 2:51pm UTC](https://discourse.pi-hole.net/t/cronjob/15446/6 "2018-12-25T14:51:11Z")

</div>

> [@max\_bachmann](#):
>
> I thought automatic updates might be a good thing since the pihole is in my parents home

The problem with automatic updates for Pi-Hole at a remote location is when Pi-Hole behavior changes with an update. As an example, when Pi-Hole 4.0 was released, the default blocking mode changed from IP to NULL. Many users wondered where their blocking page went. In V4.1, the query log now shows PTR, SOA and other types of requests (previously was A and AAAA only), and this has caused a number of questions.

For a parental installation, I would use the new version at home for a while, then decide whether it should be upgraded at the parent home. If you do update it there, you may have to make some configuration changes or explain something to them.

---

<div class="post-metadata">

**Author:** ![jfb](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/jfb/32/4332_2.png) [@jfb](https://discourse.pi-hole.net/u/jfb)\
**Post date:** [December 25, 2018, 4:30pm UTC](https://discourse.pi-hole.net/t/cronjob/15446/7 "2018-12-25T16:30:45Z")

</div>

2 posts were split to a new topic: [Static IP on Pi Zero W](https://discourse.pi-hole.net/t/static-ip-on-pi-zero-w/15452)

---

<div class="post-metadata">

**Author:** ![jpgpi250](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/jpgpi250/32/286_2.png) [@jpgpi250](https://discourse.pi-hole.net/u/jpgpi250)\
**Post date:** [December 27, 2018, 10:05am UTC](https://discourse.pi-hole.net/t/cronjob/15446/8 "2018-12-27T10:05:10Z")

</div>

I've been thinking about the update dillema and possibly found a solution, you can find it [here](https://discourse.pi-hole.net/t/a-method-to-update-pihole-on-a-remote-location/15500)
