Control Web Panel

WebPanel => How to => Topic started by: fotobo on December 28, 2015, 06:07:18 AM

Title: cron syntax help needed
Post by: fotobo on December 28, 2015, 06:07:18 AM
Hello All,

I'm having no luck in getting a cron to run as needed. I've searched the forum and tried many different options but I still can't get it done and I'm hoping someone here might have a solution. The developer of the script I use for the website this cron is required for indicates that "We advice to use the commands which ping cron's URL - not physical path to the cron php file." and gives the following examples:

/usr/bin/lynx -source http://mysite.com/members/cron_amazon.php

or

GET http://mysite.com/members/cron_amazon.php > /dev/null

I'm using php V5.4.45 and the user for the account where the website files are is "mysexy"

Thanks for your suggestions and help.


Title: Re: cron syntax help needed
Post by: Glenn on December 28, 2015, 12:13:45 PM
Hi there

What are you trying to do with the cron ? , what do you currently have that isn't working ?
Title: Re: cron syntax help needed
Post by: fotobo on December 28, 2015, 12:48:54 PM
Hello Glenn,

The file "cron_amazon.php" moves images and video uploaded to the website to an Amazon S3 server. This can be done manually by opening "http://mysite.com/members/cron_amazon.php" in a web browser, but the cron job is meant to automate the process.

I've tried various commands such as:
/usr/local/cwp/php54/bin/php -q /home/mysexy/public_html/members/cron_amazon.php

and

/usr/local/cwp/php54/bin/php -GET http://mysite.com/members/cron_amazon.php > /dev/null

but none of them load the mysite.com/members/cron_amazon.php file.
Title: Re: cron syntax help needed
Post by: Glenn on December 28, 2015, 03:26:15 PM
Ok , if you want to emulate the activity of a web browser you could use lynx

 lynx http://mysite.com/members/cron_amazon.php > /dev/null

or to just run the file let php open it but from within a folder path

php /path to file/cron_amazon.php > /dev/null

i would also try leaving the > /dev/null part out it should cause the root user to get an email with the reason the cron failed , but i think the examples above will work for you
Title: Re: cron syntax help needed
Post by: fotobo on December 30, 2015, 05:54:41 AM
Thank you again for your help Glenn. I'm still not completely clear on one part though. So in the command form would I just put in

" lynx http://mysite.com/members/cron_amazon.php > /dev/null" or is something needed with it like

" /usr/local/bin/php lynx http://mysite.com/members/cron_amazon.php > /dev/null"
Title: Re: cron syntax help needed
Post by: Glenn on December 30, 2015, 07:13:44 AM
You should just need

lynx http://mysite.com/members/cron_amazon.php > /dev/null

lynx is a text line "browser" not a php library, you may however need to install lynx

you install lynx