Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Wed May 16, 2012 2:05 pm 
Offline
Senior Newbie

Joined: Wed May 16, 2012 1:51 pm
Posts: 12
I'm trying to create a test cron job which calls a php file. I kind of understand the info in Linode's cron documentation:

I can edit a crontab file using:

crontab -e

I can create a job which runs every ten minutes:

*/10 * * * * /srv/www/mysite.com/public_html/myfolder/cron.php

But the email output (every ten minutes) is:

/bin/sh: /srv/www/mysite.com/public_html/myfolder/cron.php: Permission denied

What am I missing?


Using Ubuntu 10.04 LTS stackscript; a test wordpress install seems to be working normally


Top
   
 Post subject:
PostPosted: Wed May 16, 2012 2:30 pm 
Offline
Senior Member

Joined: Fri Feb 17, 2012 8:20 pm
Posts: 365
You're trying to execute it now. Depending on the type of script you're gonna want to do either this or this:


Code:
*/10 * * * * /usr/bin/php  srv/www/mysite.com/public_html/myfolder/cron.php 


or
Code:
 */10 * * * * cd /srv/www/mysite.com/public_html/myfolder/ && /usr/bin/php cron.php


Top
   
 Post subject:
PostPosted: Wed May 16, 2012 3:18 pm 
Offline
Senior Newbie

Joined: Wed May 16, 2012 1:51 pm
Posts: 12
that changes my error to this:

/bin/sh: /usr/bin/php: not found


Top
   
 Post subject:
PostPosted: Wed May 16, 2012 3:24 pm 
Offline
Senior Member
User avatar

Joined: Thu Nov 24, 2011 12:46 pm
Posts: 139
Location: Mesa AZ
You don't have php cli loaded. It many times is an additional package that needs to be loaded.

_________________
Kevin a.k.a. Dweeber


Top
   
 Post subject:
PostPosted: Wed May 16, 2012 4:20 pm 
Offline
Senior Member

Joined: Sun Mar 07, 2010 7:47 pm
Posts: 1970
Website: http://www.rwky.net
Location: Earth
Code:
apt-get -y install php5-cli

_________________
Paid support
How to ask for help
1. Give details of your problem
2. Post any errors
3. Post relevant logs.
4. Don't hide details i.e. your domain, it just makes things harder
5. Be polite or you'll be eaten by a grue


Top
   
 Post subject:
PostPosted: Wed May 16, 2012 4:31 pm 
Offline
Senior Newbie

Joined: Wed May 16, 2012 1:51 pm
Posts: 12
Thanks! -- installing php5-cli got the cron job to successfully trigger my target php.file.

Apparently the LAMP StackScript I was using didn't have this step in it.


Top
   
 Post subject:
PostPosted: Thu May 17, 2012 11:09 am 
Offline
Senior Member
User avatar

Joined: Tue May 26, 2009 3:29 pm
Posts: 1691
Location: Montreal, QC
PHP shell scripts are generally not a typical scenario, so they wouldn't be.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group