After dietpi upgrade crontab is empty?

I recently updated DietPi to v7.1.2

I’m running a small OLED screen to display stats of my PiHole. I have a cron setup to show it. But after the upgrade it resetted my crontab.

@reboot sh /home/dietpi/ >/home/dietpi/logs/cronlog 2>&1

What happened? I didn’t rebooted the Pi4 after the upgrade.

We do not touch crontabs, actually, aside of maybe a service user with a single purpose.

From which DietPi version did you upgrade and where did you add that cron job? /etc/crontab or /etc/cron.d/ or via crontab -e, if so which user?

DietPi themselves didn’t do anything with the crontab during DietPi code update… Did you checked the crontab for the correct user? I found some reports on the web that an apt package update for cron could lead to such side effects. But not sure how trustable something like this is

@MichaIng It was as sudo root.

====>>> So the root’s crontab shows my script! but why isn’t it executed ?

I don’t remember which version i upgraded from. I used the download from the site from couple weeks ago. Anyway i can see what version i used?

There where some updates along the way, i know it stopped working since yesterday.

the script is executed at boot but you stated you did not reboot?

I thought i didnt needed to reboot.

just give it a try and see if your script will be executed

Well i’d be damned! I thought after updating you dont need to reboot. Just major updates, and i thought nothing had really changed… Man i feel stupid now…

well before DietPi will update it’s own script, an apt package update is triggered. Probably some software packages got updated forcing your script to stop

Yes i did saw it stop cron, maybe didn’t restarted it? thats why i posted it.

cron should be restarted after the package update but your script is executed on reboot only. That’s how you set it up using @reboot :wink:

Ah yes @reboot is not triggered at cron restart, only on actual reboot :slight_smile:.