Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 5008

Raspberry Pi OS • Re: Cron doesn't want to execute a shell script that works fine on its own

$
0
0
There are significant difference between running under a logged in shell and under cron even when runing as the same user.

It's a safe bet that an attempt is being made to run your script ever minute but all output (including error messages) is being thrown away. Because without an MTA installed that's what cron does.

As with all troubleshooting, first find the error.

[shameless self promotion]
See section 6 of Cron – A Beginner's Guide
[/shameless self promotion]

Without knowing the error message all I can do is guess. And guessing usually wastes both of our time.
Hi thagrol,
I was able to identify the issue. My shell script makes use of some bash script commands that cron wasn't getting along with. I used /bin/bash -c to direct it to execute the script using bash and it is functioning perfectly now.

Statistics: Posted by phylojenie — Thu May 16, 2024 6:29 pm



Viewing all articles
Browse latest Browse all 5008

Trending Articles