Forum Moderators: coopster

Message Too Old, No Replies

cron jobs

php cron job

         

aaron5150

2:22 pm on Feb 18, 2006 (gmt 0)

10+ Year Member



Hello all,

I have read the other threads on this and still cannot get this sorted. i want to run a .php page every 2 minutes for my help desk software so it can send out automated responses.

now... the path to the file is http://www.example.com/support/cron/mailpilot.php is that enough info for someone who has a clue to be able to write down what i should type into the box to enable the cron?

someone PLEASE HELP!

[edited by: coopster at 3:46 pm (utc) on Feb. 18, 2006]
[edit reason] removed url per TOS [webmasterworld.com] [/edit]

coopster

3:49 pm on Feb 18, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Welcome to WebmasterWorld, aaron5150.

what i should type into the box to enable the cron

Are you trying to do this from some sort of software package or possibly a shared server control panel interface or something?

aaron5150

7:41 pm on Feb 22, 2006 (gmt 0)

10+ Year Member



sorry about the delayed response. i couldnt remember the website where i posted the question.

To be honest i dont know. There is some code in one of the pages of my website that will automatically check my emails and send out responses to whoever send me an email.

i really do not have a clue. everything i have tried is not working. Unfortunatly at the moment my customers do not recieve an automated acknowledgement of the emails then send to me unless i run the code manually.

coopster

4:29 pm on Feb 23, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Cron jobs are scheduled jobs. Most operating systems come with some form of job scheduler and if you are running this from a shared server or hosting package of some sort they may allow you to run cron jobs.

aaron5150

3:00 pm on Feb 24, 2006 (gmt 0)

10+ Year Member



yes i know they do allow cron jobs. im using cpanel to do this. i just need to know what to type in to run the code properly.

I have been trying again and again but i cant get the code right.

the latest code i have tried is:

php --dump /home/simplymilitary/public_html/support/cron/mailpilot.php /dev/null

but i dont know what i am doing wrong. Its a real pain and the people who host my website dont seem to know what they are doing. they keep talking about GET or WGET but it does not work as many users have said in the forums.

So if there is anyone who knows what i should type in to run the php code i would be most thankful!

jatar_k

5:29 pm on Feb 24, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



do you have shell access? if so you can test the desired command at a prompt, that might help you work out what it is you need.

I looked at this search [google.com] and found a couple good step by step tutorials. Though if all you need is the commmand then they won't help much.

are you just trying to run that script?
what os is the server running?

MattyMoose

5:47 pm on Feb 24, 2006 (gmt 0)

10+ Year Member



OK, here we go... This is what I've understood so far through all the confusion:

You use your browser to visit a page on your site, that automatically checks your email and sends a response to whomever emailed you, correct? That page is called "/support/cron/mailpilot.php"

So now you're at your CPanel control panel, and you're trying to create a cron that will do that for you, without you needing to manually do anything.

I think that's right, isn't it?

OK. Here we go:

1) When you visist mailpilot.php, do you enter anything in? Any usernames or passwords or check any boxes, or do anything or than type in the URL in your browser and press enter?

If you don't have to type anything in, then what you'll need is to type something like this in to the command box for the cron:

wget http://www.mysite.com/support/cron/mailpilot.php 

If you DO need to type something in, then have a look at the URL AFTER you've typed everything into your browser, and it's run successfully. It may look like something like this:

http://www.mysite.com/support/cron/mailpilot.php?userid=aaron&p=1234&check=yes
(That's just a sample, I don't know if it will look examctly like that).

copy the WHOLE URL, including any "GET" strings (the stuff after the "?"), and paste it into that command box like this:

wget [mysite.com...]

That will most likely do what you want it to.

If you DO type stuff in, and the URL doesn't change to include anything after the ".php", then they're using POST variables to log in or whatnot. In that case, you need to use something more akin to cURL (http://curl.haxx.se/)

Cheers, I hope that helps you on your way.

MM