After dietpi upgrade crontab is empty? Topic is solved

Having issues with your DietPi installation or found a bug? Post it here.
BadabingNL
Posts: 7
Joined: Sun Mar 28, 2021 10:27 pm

After dietpi upgrade crontab is empty?

Post by BadabingNL »

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.

Code: Select all

@reboot sh /home/dietpi/launcherstats.sh >/home/dietpi/logs/cronlog 2>&1
What happened? I didn't rebooted the Pi4 after the upgrade.
User avatar
MichaIng
Site Admin
Posts: 2917
Joined: Sat Nov 18, 2017 6:21 pm

Re: After dietpi upgrade crontab is empty?

Post by MichaIng »

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?
User avatar
Joulinar
Posts: 4503
Joined: Sat Nov 16, 2019 12:49 am

Re: After dietpi upgrade crontab is empty?

Post by Joulinar »

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 https://askubuntu.com/questions/216692/ ... tab-stored
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
BadabingNL
Posts: 7
Joined: Sun Mar 28, 2021 10:27 pm

Re: After dietpi upgrade crontab is empty?

Post by BadabingNL »

@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.
User avatar
Joulinar
Posts: 4503
Joined: Sat Nov 16, 2019 12:49 am

Re: After dietpi upgrade crontab is empty?

Post by Joulinar »

the script is executed at boot but you stated you did not reboot?
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
BadabingNL
Posts: 7
Joined: Sun Mar 28, 2021 10:27 pm

Re: After dietpi upgrade crontab is empty?

Post by BadabingNL »

I thought i didnt needed to reboot.
User avatar
Joulinar
Posts: 4503
Joined: Sat Nov 16, 2019 12:49 am

Re: After dietpi upgrade crontab is empty?

Post by Joulinar »

just give it a try and see if your script will be executed
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
BadabingNL
Posts: 7
Joined: Sun Mar 28, 2021 10:27 pm

Re: After dietpi upgrade crontab is empty?

Post by BadabingNL »

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...
User avatar
Joulinar
Posts: 4503
Joined: Sat Nov 16, 2019 12:49 am

Re: After dietpi upgrade crontab is empty?

Post by Joulinar »

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
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
BadabingNL
Posts: 7
Joined: Sun Mar 28, 2021 10:27 pm

Re: After dietpi upgrade crontab is empty?

Post by BadabingNL »

Yes i did saw it stop cron, maybe didn't restarted it? thats why i posted it.
Last edited by BadabingNL on Sat May 01, 2021 12:18 am, edited 1 time in total.
Post Reply