linux - Phantomjs is not working in crontab - Raspberry Pi -


i want run phantomjs script crontab on raspberry pi 3 not working.

i have phantomjs script code:

console.log('hello world'); phantom.exit(); 

if run manuel terminal, works. if run script crontab, become no output.

terminal command:

phantomjs /home/pi/desktop/testjs.js > /home/pi/desktop/testjs.txt 

in crontab have added line:

* * * * * phantomjs /home/desktop/testjs.js > /home/pi/desktop/testjs.txt 

the output empty file.

then have tested answers question starting phantomjs script in cronjob have same output, empty file. have tested every answer alone , combined.

also have created shell script

#!/bin/sh phantomjs /home/pi/desktop/testjs.js > /home/pi/desktop/testjs.txt 

but same empty output file. if run terminal works.

after have tested every command phantomjs absolute path:

/usr/local/bin/phantomjs  /home/pi/desktop/testjs.js > /home/pi/desktop/testjs.txt 

but nothing works...

i tried use sudo crontab.

here syslog output:

jul 26 09:47:01 raspberrypi cron[26612]: (pi) cmd (/home/pi/desktop/testjs.js > /home/pi/desktop/testjs.txt)

jul 26 09:48:01 raspberrypi cron[27156]: (pi) cmd (/home/pi/desktop/testjs.js > /home/pi/desktop/testjs.txt)

jul 26 09:49:01 raspberrypi cron[27629]: (pi) cmd (/home/pi/desktop/testjs.js > /home/pi/desktop/testjs.txt)

jul 26 09:50:01 raspberrypi cron[28015]: (pi) cmd (/home/pi/desktop/testjs.js > /home/pi/desktop/testjs.txt)

jul 26 09:51:01 raspberrypi cron[28434]: (pi) cmd (/home/pi/desktop/testjs.js > /home/pi/desktop/testjs.txt)

jul 26 09:52:01 raspberrypi cron[28859]: (pi) cmd (/home/pi/desktop/testjs.js > /home/pi/desktop/testjs.txt)

jul 26 09:53:01 raspberrypi cron[29209]: (pi) cmd (phantomjs /home/pi/desktop/testjs.js >> /home/pi/desktop/testlog.txt)

jul 26 09:54:01 raspberrypi cron[29709]: (pi) cmd (phantomjs /home/pi/desktop/testjs.js >> /home/pi/desktop/testlog.txt)

jul 26 09:55:01 raspberrypi cron[30215]: (pi) cmd (phantomjs /home/pi/desktop/testjs.js >> /home/pi/desktop/testlog.txt)

jul 26 09:56:01 raspberrypi cron[30606]: (pi) cmd (phantomjs /home/pi/desktop/testjs.js >> /home/pi/desktop/testlog.txt)

jul 26 09:57:01 raspberrypi cron[31070]: (pi) cmd (/usr/local/bin/phantomjs /home/pi/desktop/testjs.js >> /home/pi/desktop/testlog.txt)

jul 26 09:58:02 raspberrypi cron[31490]: (pi) cmd (/usr/local/bin/phantomjs /home/pi/desktop/testjs.js >> /home/pi/desktop/testlog.txt)

jul 26 09:59:01 raspberrypi cron[31901]: (pi) cmd (/usr/local/bin/phantomjs /home/pi/desktop/testjs.js >> /home/pi/desktop/testlog.txt)

jul 26 10:00:01 raspberrypi cron[32283]: (pi) cmd (/usr/local/bin/phantomjs /home/pi/desktop/testjs.js >> /home/pi/desktop/testlog.txt)

jul 26 10:00:01 raspberrypi cron[32284]: (root) cmd (/usr/local/bin/phantomjs /home/pi/desktop/testjs.js >> /home/pi/desktop/testlog.txt)

how can solve problem? have no more ideas.


Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -