New to cron on debian 9 , I have a file called ipupdate in /etc/cron.hourly/ipupdate

-rwxr-xr-x 1 root root 132 Jul 11 18:21 ipupdate

the file has a single curl command like this:

curl "https://..."

if I run the script manually it runs just fine

in my logs I see:

Jul 17 14:17:02 dpi CRON[12248]: (root) CMD ( cd / && run-parts --report /etc/cron.hourly)

the script is not being executed (my ip is not updated), why ? how can I troubleshoot please ?


There are different possible reasons.

A common problem is that the environment is not what the script expects. In particular, it might be that some programs are not in $PATH, although curl is probably part of your distribution and therefor in the standard PATH.

You should add a line #!/bin/sh at the top of the file.

In the script, you can add the line

exec >> /tmp/log 2>&1

Then if the file is not created, the script is not executed. If the file is created, check for clues why is doesn't work.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.