0

I have exactly the same problem : https://askubuntu.com/a/117989/1012849

What i don't understand it's how to specify path of SHELL=/bin/sh Because i can't move my script from :

/home/ubuntu/folder/monitoring.sh

do I have to specify the path on my script or on the crontab? and how can I retrieve the path?

there's the content of my crontab :

*/1 7-19 * * * /home/ubuntu/folder/monitoring.sh

Content of monitoring.sh

#!/bin/bash

touch testcronsh.txt
python monitoring.py

Actually when i try to execute my script via crontab i have that error :

/bin/sh: 1: root: not found 
cttech
  • 1

1 Answers1

0

Okai I have found the solution.

First thing to know i'm a beginner in linux env.

So i have created a monitoring.sh script with chmod 770. this file call an other file named monitoring.py who got chmod 770.

Than i add the monitoring.sh on my crontab.

What i didn't know it's the crontab user isn't the same

So the call of my python script on my .sh script must have the full path

monitoring.sh

#!/bin/bash

touch testcronsh.txt
python /home/ubuntu/folder/monitoring.py 
cttech
  • 1