casperjs not working by cron

234 views
Skip to first unread message

CasperJS

unread,
Jul 14, 2015, 2:15:15 PM7/14/15
to casp...@googlegroups.com

casperjs is not work by cron.. so, I maked test shell script

test.sh file ..........

#!/bin/sh
casperjs --version

/etc/crontab file..

40 17 * * * root    /home/test/html/run/test.sh >> /home/test/html/run/test.sh.log

.bash_profile file .......

export PHANTOMJS_EXECUTABLE=/usr/local/bin/phantomjs

If run the console is work.

# sh test.sh 

test.sh.log is being recorded.

# cat test.sh.log
1.1.0-beta3

but cron not record..

# ps ax|grep phantomjs
 9531 ?        Rl    16:47 /usr/local/bin/phantomjs /usr/local/casperjs/bin/bootstrap.js --casper-path=/usr/local/casperjs --cli --version

Thus it shows only and may not be executed.


I can not solve this problem for more than one months.

please.. help me.


Gabe Misura

unread,
Jul 15, 2015, 11:54:56 AM7/15/15
to casp...@googlegroups.com, casp...@googlegroups.com
In test.sh, put the full path to casperjs or make sure your path is updated. My cron is working just fine. My shell script has
PATH=$PATH:/usr/local/bin/
to make sure casper and phantom are in the path.
Cron does not usually setup all of the env vars you normally have when you login.
Reply all
Reply to author
Forward
0 new messages