XILO Community Forum

Support 0345 468 0005 • Sales 0800 848 8468 • sales chat

Go Back   XILO Community Forum > Customer Support > Support Queries > Cron Job
Support Queries This forum should be used to contact our support team should you have any problems with your account.

Closed Thread
 
LinkBack Thread Tools Display Modes
  (#1 (permalink)) Old
User
rawedge is on a distinguished road
 
Posts: 8
Join Date: Aug 2006
Default Cron Job - 26/08/2006, 7:09 PM

I've found the Cron Job editor in Hspere but i'm a bit perplexed

I want to set up a a cron job to periodically view http://mydowmain.co.uk/wp-mail.php

how do I fill the thing in to do this, i think the command is

wget -N http://mydomain/wp-mail.php

but I don't get all the numbers bit

cheers

Rawedge

Last edited by rawedge; 26/08/2006 at 7:22 PM..
  (#2 (permalink)) Old
User
A-Wing is on a distinguished road
 
A-Wing's Avatar
 
Posts: 23
Join Date: Aug 2006
Location: N. Wales
Send a message via MSN to A-Wing Send a message via Skype™ to A-Wing
Default Re: Cron Job - 26/08/2006, 11:06 PM

ok, if it is anything like the crontab I know and love the numbers are as follows:

"Minutes" "Hours" "Day of Month" "Month of Year" "Day of Week"

So if you want something to run every 5 minutes you can do:

*/5 * * * * /path/to/executable

Or 13:43 every day:

43 13 * * * /path/to/executable

I hope this makes it clearer.
  (#3 (permalink)) Old
User
raw-edge is on a distinguished road
 
Posts: 3
Join Date: Jun 2006
Default Re: Cron Job - 28/08/2006, 9:24 PM

I've tried that and it isrunning the command every 15 minutes however I can't get the command right, i've tried putting www. and not using it in the domain bit, but i'm getting permission denied errors in the email it sends e.g

/bin/sh: /usr/bin/wget: Permission denied
)

any suggestions to what the command would be? do I need shell access turned on?
  (#4 (permalink)) Old
User
A-Wing is on a distinguished road
 
A-Wing's Avatar
 
Posts: 23
Join Date: Aug 2006
Location: N. Wales
Send a message via MSN to A-Wing Send a message via Skype™ to A-Wing
Default Re: Cron Job - 28/08/2006, 9:30 PM

Thatt basically means the user you are adding the cron jobs on doesn't have access to the 'wget' command. This is for good reason as many hack attempts use 'wget' to exploit servers.
You can get round this by changing the permissions on /usr/bin/wget, or running the cron job as a higher privilaged user.
Shell access only turns on SSH so you shouldn't need that for the cron jobs (although if you get stuck then you may need to SSH in and do it as root or something similar.

Regards
Andrew
  (#5 (permalink)) Old
User
raw-edge is on a distinguished road
 
Posts: 3
Join Date: Jun 2006
Default Re: Cron Job - 28/08/2006, 9:43 PM

cheers, I don't suppose anyone knows what is supported on the sharted servers?

i'll give curl and lynx a try

thanks

R
  (#6 (permalink)) Old
User
A-Wing is on a distinguished road
 
A-Wing's Avatar
 
Posts: 23
Join Date: Aug 2006
Location: N. Wales
Send a message via MSN to A-Wing Send a message via Skype™ to A-Wing
Default Re: Cron Job - 28/08/2006, 9:53 PM

I'm on VPS so can't really advise on the shared setup. Time for me to step down and XILO techs to step in

If you get really stuck though you should be able to re-write your script in a shell php script and use php's curl functions (if enabled on the server).

Assuming the hosting server runs CentOS or another RedHat derivative you should find 'links' will work instead of 'lynx' if installed.
  (#7 (permalink)) Old
Techie & Moderator
Kieran is on a distinguished road
 
Kieran's Avatar
 
Posts: 764
Join Date: Apr 2006
Location: Swindon, UK
Default Re: Cron Job - 28/08/2006, 10:31 PM

wget doesn't work on shared servers at xilo. You can use GET or php to execute php files in cron jobs.
  (#8 (permalink)) Old
User
rawedge is on a distinguished road
 
Posts: 8
Join Date: Aug 2006
Default Re: Cron Job - 29/08/2006, 5:46 PM

Thanks folks, i've had no luck getting it to work, I can get the time fine but it's the command that I can't get i've tried lynx CURL GET and WGET, but clearly I can't get the command correct
  (#9 (permalink)) Old
Techie & Moderator
Kieran is on a distinguished road
 
Kieran's Avatar
 
Posts: 764
Join Date: Apr 2006
Location: Swindon, UK
Default Re: Cron Job - 29/08/2006, 7:05 PM

Try "php", so your cron might be:-

php /home/USER/public_html/wp-mail.php

You also might like to try GET in the following format; I am using this format for WordPress on a shared server and it is working fine.

GET http://www.domain.co.uk/wp-mail.php > /dev/null

Last edited by Kieran; 29/08/2006 at 7:08 PM.. Reason: Addition and clarification
  (#10 (permalink)) Old
User
A-Wing is on a distinguished road
 
A-Wing's Avatar
 
Posts: 23
Join Date: Aug 2006
Location: N. Wales
Send a message via MSN to A-Wing Send a message via Skype™ to A-Wing
Default Re: Cron Job - 29/08/2006, 7:33 PM

Or write a php script to do it and at the top put:
#!/usr/bin/php

Then it can be executed as a shell script
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes



Powered by vBulletin | XHTML | © Copyright 2003-2009 XILO Communications Ltd. All rights reserved. E&OE