Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Crontab no error but doesn't execute script

Tags:

cron

freebsd

I'm trying to execute a shell script from cron on Freebsd.

To test whether crontab is working at all, I wrote the line

  * * * * * echo "Hello" > /home/myuser/logile  

and it work fine.

But when trying to execute any script it doesn't do anything, not even an error. (In the script I tried to run is just the same echo command) Below is the output of crontab -l:

SHELL=/bin/sh  
PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin  
HOME=/home/myuser  
MAILTO=myuser  
* * * * * /home/myuser/shellscript.sh > /home/myuser/logfile  

Why is the script not getting executed, although crontab is obviously running? Permission for all files are set to rwxr-xr-x.

like image 738
crontabOnFreebsd Avatar asked Sep 05 '25 16:09

crontabOnFreebsd


1 Answers

* * * * * /bin/sh /home/myuser/shellscript.sh

or

* * * * * /bin/bash /home/myuser/shellscript.sh

worked for me in Macosx 10.6 as rootuser

like image 140
user509443 Avatar answered Sep 10 '25 02:09

user509443