Solved lynx in crontab

Hi,
I woild like to execute a php script using lynx in a crontab so I did:
crontab -e
Code:
SHELL=/bin/sh
PATH=/bin:/sbin:/usr/bin:/usr/sbin
HOME=/var/log

#minute (0-59)
#|  hour (0-23)
#|  |  day of the month (1-31)
#|  |  |  month of the year (1-12 or Jan-Dec)
#|  |  |  |  day of the week (0-6 with 0=Sun or Sun-Sat)
#|  |  |  |  |  commands
#|  |  |  |  |  |
#
*/2  1  *  *  *  /usr/local/bin/lynx -dump https://www.mydomain.co.uk/cart/myscript.php
The above is suppose to execute every 2 minutes but nothing is happening.

I also tried to create a shell script with
Code:
#!/bin/sh
lynx -dump https://www.mydomain.co.uk/cart/myscript.php
and added the following in the crontab
Code:
*/2  1  *  *  * /root/tools/cart_cron.sh >> /dev/null 2>&1
Still not working.
If I run the script manually then it all work. same for lynx, manually everything is fine

Any sugestion?
 
Look for errors in /var/log/cron and redirect the output of the script to a log file.
 
As you appear to be discarding the output (by redirecting to /dev/null), it would possibly be overall more efficient to use /usr/bin/fetch, or ftp/curl from ports. That saves the overhead of parsing and rendering the HTML. Very likely much lower memory usage, and less CPU and real time. For example:

Code:
/usr/bin/fetch -o /dev/null https://www.mydomain.co.uk/cart/myscript.php
 
Murph
I have used your option for one of my job but I keep receiving email with the following:
Code:
fetch: https://www.mydomain.co.uk/cart/myscript.php: size of remote file is not known /dev/null  0  B    0  Bps
Could you please help
 
Back
Top