Author Topic: cron syntax help needed  (Read 14252 times)

0 Members and 1 Guest are viewing this topic.

Offline
*
cron syntax help needed
« 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.



Offline
**
Re: cron syntax help needed
« Reply #1 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 ?

Offline
*
Re: cron syntax help needed
« Reply #2 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.

Offline
**
Re: cron syntax help needed
« Reply #3 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
« Last Edit: December 28, 2015, 03:54:19 PM by Glenn »

Offline
*
Re: cron syntax help needed
« Reply #4 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"

Offline
**
Re: cron syntax help needed
« Reply #5 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