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


Cron Jobs





abhinav_shah
I have a script called xyz.php.
It's path is http://www.abhinav.frih.net/xyz.php
Now I want to run this script as a cron job every minute,hour,day,month.
Can anyone tell me what path should I give in the Command field in the DirectAdmin/Advanced Tools/Cron Jobs.
ml
the command must be
Code:
php /path/to/your/script.php
Grimboy
Make sure to put it in a directory that you put a password restriction on so that it can't be executed over the internet users.
charliehk
do you mean don't put in under public_html?

Is that all we have to do?

Why must we set a password restriction? If so, should we set the password restriction so that only the owner of the cron job could execute the php script?

How to do the set up? Could you give an example?

thanks a lot!!!

Grimboy wrote:
Make sure to put it in a directory that you put a password restriction on so that it can't be executed over the internet users.
Grimboy
Yeah, just don't put it in public_html. But if you do you can use a .httpconfig password thingy with no passwords to stop it being served to users.
JustaMin
You would set up a passwrod protected directory using .htaccess and .htpasswd and keep your cron scripts in there. To run them, you would use a comand such as:

Code:
wget -q --http-user 'USERNAME' --http-passwd 'PASSWORD' http://www.justaminute.me.uk/admin/backup.php


(this code runs a site backup scipt)
avk
Hey!!
What do u mean by cron jobs!!

U see
I dont know what it means

abhinav_shah wrote:
I have a script called xyz.php.
It's path is http://www.abhinav.frih.net/xyz.php
Now I want to run this script as a cron job every minute,hour,day,month.
Can anyone tell me what path should I give in the Command field in the DirectAdmin/Advanced Tools/Cron Jobs.
charliehk
thank you for your code, it is brilliant and elegant!

by the way, cron job is Linux scheduled jobs, just like the scheduled job (the command is "at") in Windows NT.
JustaMin wrote:
You would set up a passwrod protected directory using .htaccess and .htpasswd and keep your cron scripts in there. To run them, you would use a comand such as:

Code:
wget -q --http-user 'USERNAME' --http-passwd 'PASSWORD' http://www.justaminute.me.uk/admin/backup.php


(this code runs a site backup scipt)
thnn
You could put the cronjob file in a directory in the directory before your public_html folder. Then you can call it using the full path. Also this way it cannot be access by anyone.
srijit
err.... where exactely can i add the cron job in DirectAdmin. i cant find the area Sad

edit: i found that cron jobs are OFF. is that permanent? or do we have to request to enable cron jobs?
n0obie4life
You have to post a request in this forum to enable your cron jobs.

http://www.frihost.com/forums/vf-7.html
srijit
n0obie4life wrote:
You have to post a request in this forum to enable your cron jobs.

http://www.frihost.com/forums/vf-7.html

thank you for the info Very Happy i will do that.
charliehk
Do we have to post a number of replies before we could have the privilege to use cron jobs? And are there any limitations imposed?

n0obie4life wrote:
You have to post a request in this forum to enable your cron jobs.

http://www.frihost.com/forums/vf-7.html
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 - running a php file
Executing automated tasks without using cron jobs
cron jobs?
Problems With Cron Jobs
Enabling Cron Jobs
how do I auto backup using cron jobs
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.