I have a node script inside
/home/pi/Blynk/script.js. I've followed various posts online relating using cron and
/etc/init.d, however none seem to be working. The script must be run via sudo, I've checked the log and it shows the command being run, but it's not running the script. Here is what I added to cron
(This cron below runs the Blynk server and works)
@reboot java -jar /home/pi/server-0.27.1.jar -dataFolder /home/pi/Blynk &
(This cron runs the script with user root and node yet doesn't work)
@reboot /usr/bin/sudo -u root -H /usr/bin/node /home/pi/Blynk/script.js
Could someone please show me where I've gone wrong?