FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


FriHost Cron Jobs





medesignz
I am trying out cron jobs to send out an email (just as a test to a personal email account) and am struggling to get it to work...

The site is hosted via FriHost and is associated via a domain.

Has anyone got any tips or a tutorial as to how to set one up on FriHost
rjraaz
I personally advice you to search the forum before making any new thread.

here are the some forum links that will help you

http://www.frihost.com/forums/vt-113492.html
http://www.frihost.com/forums/vt-75778.html
http://www.frihost.com/forums/vt-72534.html
http://www.frihost.com/forums/vt-26285.html
http://www.frihost.com/forums/vt-74396.html

After reading all these post if you still have problems ask here again.

But be careful about server load as according to discussion on http://www.frihost.com/forums/vt-76033.html#639638 your account may be suspended if your cronjob script of overload the server.
medesignz
Thanks for the references.

It gave me a few tips, but its not sending the simple mail message.

The job is to run every *hour at 30minutes.

The command is
Code:
usr/local/bin/php -q /home/USER/domains/DOMAIN/public_html/cronjob.php


and the actual code to execute is
Code:
<?php

mail("xxx@gmail.com","TEST - Cron Job","This is a test","From: xxx@gmail.com");

?>


Permissions are set to totally open 777 on the file.

What am I not doing right?
rjraaz
medesignz wrote:
Thanks for the references.

The command is
Code:
usr/local/bin/php -q /home/USER/domains/DOMAIN/public_html/cronjob.php




Ok fine it seems that you did not replace USER with your own Username

And DOMAIN with your Own domain

Quote:

and the actual code to execute is
Code:
<?php

mail("xxx@gmail.com","TEST - Cron Job","This is a test","From: xxx@gmail.com");

?>


Permissions are set to totally open 777 on the file.

What am I not doing right?


i have checked this script manually by replacing address with my own addresses it works fine.
medesignz
rjraaz wrote:

Ok fine it seems that you did not replace USER with your own Username

And DOMAIN with your Own domain



Sorry for the confusion, but i have replaced the User and Domain, but I did not want to post them on the forum.

I know the script works manually, but it is not working as a cronjob
Fire Boar
Also it should be /usr/local/bin/php, not usr/local/bin/php. Assuming that's where Frihost has its PHP installation, I'm not entirely sure about that.
rjraaz
Yes Fire Boar is right. That is the reason why your cron is not working.
Here i am going include a screen capture for your reference to setup cron at directadmin. Hope it will help.

medesignz
Great! That seemed to work.

One q, why should (for example) the minutes be */30 rather than just 30?
Peterssidan
medesignz wrote:
One q, why should (for example) the minutes be */30 rather than just 30?

If you just write 30 the cron job will run exactly on minute 30 every hour. If you write */30 it means it will run every 30 minutes. So */30 will run twice as often as 30.
medesignz
Thanks all.. Very Happy
rjraaz
Here on http://www.cyberciti.biz/faq/how-do-i-add-jobs-to-cron-under-linux-or-unix-oses/

more option details that you can try to play with but remember that your script wont overload the server.
medesignz
Thanks for the reference, I shall check it out soon Very Happy
Related topics
Cron Jobs
propos des cron jobs
[RESOLVED] cron jobs
Cron jobs
I don't have cron jobs enabled ?
cron jobs
Cron Jobs
Cron Jobs
Cron Jobs
Cron jobs - running a php file
Executing automated tasks without using cron jobs
cron jobs?
Does FtiHost Support Cron Jobs?
Has anyone installed Moodle successfully?
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.