Page 1 of 1

manually started works, not in crontab

Posted: Saturday 21 October 2017 16:50
by curious
When I run ./nas_2.sh manually in /domoticz/scripts I get results. But when in crontab
*/5 * * * * /home/pi/domoticz/scripts/nas_2.sh

nothing happens.

Who can help me to run nash_2.sh with crontab ?

Re: manually started works, not in crontab

Posted: Saturday 21 October 2017 22:22
by emme
try to enter it in the root crontrab

sudo crontab -e

Re: manually started works, not in crontab

Posted: Monday 23 October 2017 20:23
by curious
Thank you for answering.
I think I did not made myself clear. The problem is not that I cannot get this line in the crontab,

the problem is that it does not seem to run, and I don't know why

Re: manually started works, not in crontab

Posted: Monday 23 October 2017 20:43
by SweetPants
What is ls -lia nash_2.sh tell you?

Re: manually started works, not in crontab

Posted: Monday 23 October 2017 21:02
by curious
When I run the command from root : ls:cannot access nas_2.sh no such file or directory
when I run it from /domoticz/scripts : 1223637 -rwxr -xr -x 1 pi pi 6806 oct 18 21:06 nas_2.sh

Re: manually started works, not in crontab

Posted: Monday 23 October 2017 21:15
by EddyG
Change to: */5 * * * * root /home/pi/domoticz/scripts/nas_2.sh

Re: manually started works, not in crontab

Posted: Monday 23 October 2017 21:16
by SweetPants
curious wrote: Saturday 21 October 2017 16:50 When I run ./nas_2.sh manually in /domoticz/scripts I get results. But when in crontab
*/5 * * * * /home/pi/domoticz/scripts/nas_2.sh
/home/pi/domoticz/scripts and /domoticz/scripts are two different directories