Cron not working? Topic is solved

Having issues with your DietPi installation or found a bug? Post it here.
Post Reply
nickieemp
Posts: 2
Joined: Sun Nov 21, 2021 8:26 pm

Cron not working?

Post by nickieemp »

Dear forum peers,

I have installed Dietpi and I absolutely love it. So much faster, lightweight etc etc.

I have installed pi-hole, PiVPN and unbound and everything works well. However, I have DDNS and cron does not seem to work.
I am new to the idea of Dietpi having its own folders so I may be doing something wrong here. I have installed my script in both cron minutely(every 5 minutes) and cron hourly (default on the 17th minute of each hour). If I run the script ovh.sh, it immediately updates the IP so i know it works. However, cron does not run it as dietpi wants it to. There seems to be no crontab for me to change. What am I doing wrong? Is there a switch to turn on cron?

Code: Select all

root@RPi:/etc/cron.hourly# cat ovh.sh
#!/bin/bash

#Run OVH update
/usr/local/bin/dyndns.sh > /dev/null 2>&1

root@RPi:/etc/cron.hourly# cd /etc/cron.minutely/

root@RPi:/etc/cron.minutely# ls
ovh.sh  readme.txt

root@RPi:/etc/cron.minutely# ls -lrt
total 8
-rw-r--r-- 1 root root 163 Nov 21 08:41 readme.txt
-rwxr-xr-x 1 root root  71 Nov 21 16:01 ovh.sh

root@RPi:/etc/cron.minutely# ls -lrt /etc/cron.hourly/
total 12
-rwxr-xr-x 1 root root  191 Feb 22  2012 fake-hwclock
-rwxr-xr-x 1 root root 1318 Nov 21 08:41 dietpi
-rwxr-xr-x 1 root root   71 Nov 21 17:27 ovh.sh
root@RPi:/etc/cron.minutely#
nickieemp
Posts: 2
Joined: Sun Nov 21, 2021 8:26 pm

Re: Cron not working?

Post by nickieemp »

Judging from here, all I needed to do is just remove the ending from ovh.sh to just ovh
User avatar
Joulinar
Posts: 6441
Joined: Sat Nov 16, 2019 12:49 am

Re: Cron not working?

Post by Joulinar »

yes correct, you would need to remove the .sh from your script.

As an alternative you could have a look to dietpi-ddns. If you have an update link, you would use the custom entry.
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
Post Reply