manually started works, not in crontab

All kinds of 'OS' scripts

Moderator: leecollings

Post Reply
curious
Posts: 132
Joined: Saturday 02 April 2016 19:38
Target OS: -
Domoticz version:
Contact:

manually started works, not in crontab

Post 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 ?
User avatar
emme
Posts: 909
Joined: Monday 27 June 2016 11:02
Target OS: Raspberry Pi / ODroid
Domoticz version: latest
Location: Milano, Italy
Contact:

Re: manually started works, not in crontab

Post by emme »

try to enter it in the root crontrab

sudo crontab -e
The most dangerous phrase in any language is:
"We always done this way"
curious
Posts: 132
Joined: Saturday 02 April 2016 19:38
Target OS: -
Domoticz version:
Contact:

Re: manually started works, not in crontab

Post 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
SweetPants

Re: manually started works, not in crontab

Post by SweetPants »

What is ls -lia nash_2.sh tell you?
curious
Posts: 132
Joined: Saturday 02 April 2016 19:38
Target OS: -
Domoticz version:
Contact:

Re: manually started works, not in crontab

Post 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
EddyG
Posts: 1042
Joined: Monday 02 November 2015 5:54
Target OS: -
Domoticz version:

Re: manually started works, not in crontab

Post by EddyG »

Change to: */5 * * * * root /home/pi/domoticz/scripts/nas_2.sh
SweetPants

Re: manually started works, not in crontab

Post 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
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest