manually started works, not in crontab

All kinds of 'OS' scripts
Post Reply
curious
Posts: 134
Joined: Saturday 02 April 2016 19:38
Target OS: -
Domoticz version:
Contact:

manually started works, not in crontab

Post by curious » 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

nothing happens.

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

User avatar
emme
Posts: 847
Joined: Monday 27 June 2016 11:02
Target OS: Raspberry Pi
Domoticz version: latest
Location: Milano, Italy
Contact:

Re: manually started works, not in crontab

Post by emme » Saturday 21 October 2017 22:22

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: 134
Joined: Saturday 02 April 2016 19:38
Target OS: -
Domoticz version:
Contact:

Re: manually started works, not in crontab

Post by curious » Monday 23 October 2017 20:23

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
Posts: 2250
Joined: Friday 12 July 2013 21:24
Target OS: Linux
Domoticz version: V4.9999
Location: The Netherlands
Contact:

Re: manually started works, not in crontab

Post by SweetPants » Monday 23 October 2017 20:43

What is ls -lia nash_2.sh tell you?
Ubuntu 16.04.3 LTS, Intel NUC, MySensors 2.3.0-alpha, Pro Mini 3.3/8M RFM69(HW), ESP8266 (SDK2.2.0), Sonoff, RFLink, RFXcom, MQTT, NodeRed, Domoticz Beta (from source)

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

Re: manually started works, not in crontab

Post by curious » Monday 23 October 2017 21:02

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

User avatar
EddyG
Posts: 313
Joined: Monday 02 November 2015 6:54
Target OS: Raspberry Pi
Domoticz version: 4.9999
Location: Rhenen, Netherlands
Contact:

Re: manually started works, not in crontab

Post by EddyG » Monday 23 October 2017 21:15

Change to: */5 * * * * root /home/pi/domoticz/scripts/nas_2.sh
Regards,
Eddy

SweetPants
Posts: 2250
Joined: Friday 12 July 2013 21:24
Target OS: Linux
Domoticz version: V4.9999
Location: The Netherlands
Contact:

Re: manually started works, not in crontab

Post by SweetPants » Monday 23 October 2017 21:16

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
Ubuntu 16.04.3 LTS, Intel NUC, MySensors 2.3.0-alpha, Pro Mini 3.3/8M RFM69(HW), ESP8266 (SDK2.2.0), Sonoff, RFLink, RFXcom, MQTT, NodeRed, Domoticz Beta (from source)

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest