Author |
Message |
billdavies
Senior WebHelper
Joined: 22 Jan 2002
Posts: 107
Location: UK
|
Posted:
Tue Nov 05, 2002 6:41 pm (21 years, 5 months ago) |
|
Some people these days....
I don't wanna use it to spam! I am running this silly competition thing for someone and I wanted to take them by surprise...long story.
Anyway.
I made the file crontest.php and uploaded it to www.extremelinks.net/crontest.php. It looked like this:
mail("ploptyplop@hotmail.com", "Hey", "Just a test", "From:Bill <billdavies@f2s.com>");
(this is just a test for me!)
I did what you said for all the boxes and under Command I wrote
/usr/local/bin/lynx --dump http://extremelinks.net/crontest.php
Is that all right?
I only want this to run once, now would I do that?
EDIT: Ok, I am really confused. My host told me he thinks (not always a good sign!) that the servers are set to Eastern Time blah blah blah. Now, I set up the above to run so that I would get it whilst I was on now. I haven't got anything, so I checked the time. I used
<html>
<body>
<?php echo gmdate("H i s M d Y");
?>
</body>
</html>
(just checking I did it right!) and it said that the server was running in GMT. So I set up another cron job and that hasn't worked. So what have I done wrong and what time zone is the server in?
Thanks |
|
|
|
|
billdavies
Senior WebHelper
Joined: 22 Jan 2002
Posts: 107
Location: UK
|
Posted:
Tue Nov 05, 2002 6:59 pm (21 years, 5 months ago) |
|
Whoops! Forgot everything else on the crontest.php file.
That file then worked (I tested it!) but the cron thing still doesn't work. I even set it up to do every hour on a minute and it still didn't work so there is a problem somewhere. I tried dropping all the random stuff I don't understand at the front and just put the URL but that didn't either.
What am I doing wrong?! |
|
|
|
|
Daniel
Team Member
Joined: 06 Jan 2002
Posts: 2564
|
Posted:
Tue Nov 05, 2002 7:00 pm (21 years, 5 months ago) |
|
OK, well if you only want to run it once, then just go to http://extremelinks.net/crontest.php.
As to the timezone, running gmdate will always return a GMT time. To find out the timezone, run this PHP code:
|
________________________________
|
|
|
|
Daniel
Team Member
Joined: 06 Jan 2002
Posts: 2564
|
Posted:
Tue Nov 05, 2002 7:00 pm (21 years, 5 months ago) |
|
OK, tell me what you have in every box and we'll see what's wrong. |
________________________________
|
|
|
|
billdavies
Senior WebHelper
Joined: 22 Jan 2002
Posts: 107
Location: UK
|
Posted:
Tue Nov 05, 2002 8:44 pm (21 years, 5 months ago) |
|
Ok. crontest.php looked like this:
<html>
<body>
<?php mail("ploptyplop@hotmail.com", "Hey", "Just a test", "From:Bill <billdavies@f2s.com>");
?>
</body>
</html>
This is what my crontab looks like (by the way in the command I have:
/usr/local/bin/lynx --dump http://extremelinks.net/crontest.php
if you can't see it all).
It is running in Eastern Standard Time if that helps. |
|
|
|
|
Daniel
Team Member
Joined: 06 Jan 2002
Posts: 2564
|
Posted:
Tue Nov 05, 2002 8:53 pm (21 years, 5 months ago) |
|
|
|
|
billdavies
Senior WebHelper
Joined: 22 Jan 2002
Posts: 107
Location: UK
|
Posted:
Tue Nov 05, 2002 9:27 pm (21 years, 5 months ago) |
|
Yup, and loads of lovely people keep visiting it!! |
|
|
|
|
Daniel
Team Member
Joined: 06 Jan 2002
Posts: 2564
|
Posted:
Wed Nov 06, 2002 3:10 pm (21 years, 5 months ago) |
|
Just one thing: I would try creating another PHP script which sends a different email and NOT giving out the address Then see if it works. If not then I would ask your host. |
________________________________
|
|
|
|
billdavies
Senior WebHelper
Joined: 22 Jan 2002
Posts: 107
Location: UK
|
Posted:
Wed Nov 06, 2002 4:02 pm (21 years, 5 months ago) |
|
You have 32 new email addresses. Thanks....!
I got this from my host:
"I am not sure if a PHP file can be run by Cron, the only thing I have
experience with is Perl files and so on. The Cron jobs are running correctly
thought because we are using one to backup our MySQL databases every night."
That sounds like right rubbish to me. I thought he was really helpful but he doesn't seem to have a clue now I've given him my money!
Where do I go from here, is there something else I can do to test if Cron actually works with PHP?
Can you do cron manually i.e not through an interface?
Thanks
Bill |
|
|
|
|
adam
Forum Moderator & Developer
Joined: 26 Jul 2002
Posts: 704
Location: UK
|
Posted:
Thu Nov 07, 2002 5:35 pm (21 years, 5 months ago) |
|
just a thought:
[adammc@phenix adammc]$ links --dump http://www.cuo.org.uk/
Unknown option --dump
the option is -dump not --dump |
________________________________ It's turtles all the way down... |
|
|
|
Daniel
Team Member
Joined: 06 Jan 2002
Posts: 2564
|
Posted:
Thu Nov 07, 2002 5:51 pm (21 years, 5 months ago) |
|
Wierd... it's --dump at 4WebHelp. Maybe it's because it's CPanel? |
________________________________
|
|
|
|
adam
Forum Moderator & Developer
Joined: 26 Jul 2002
Posts: 704
Location: UK
|
Posted:
Thu Nov 07, 2002 6:36 pm (21 years, 5 months ago) |
|
maybe it's 'cause you're using lynx and I checked it in links... |
________________________________ It's turtles all the way down... |
|
|
|
billdavies
Senior WebHelper
Joined: 22 Jan 2002
Posts: 107
Location: UK
|
Posted:
Thu Nov 07, 2002 6:39 pm (21 years, 5 months ago) |
|
Daniel wrote: | Just one thing: I would try creating another PHP script which sends a different email and NOT giving out the address :) Then see if it works. If not then I would ask your host. |
What does that mean? I don't put a From section?
I tried losing the second dash but that hasn't worked.
Where did you actually get the /usr/local/bin/lynx bit from?
Bill |
|
|
|
|
Daniel
Team Member
Joined: 06 Jan 2002
Posts: 2564
|
Posted:
Thu Nov 07, 2002 6:51 pm (21 years, 5 months ago) |
|
/usr/local/bin/lynx is the path to lynx, a web browser.
Quote: |
What does that mean? I don't put a From section?
|
I mean make another copy of the script, and change the subject or something so that you know the email has been sent from the second script. Don't give out the URL, and then see if it works.... |
________________________________
|
|
|
|
billdavies
Senior WebHelper
Joined: 22 Jan 2002
Posts: 107
Location: UK
|
Posted:
Thu Nov 07, 2002 8:42 pm (21 years, 5 months ago) |
|
Ok, I did that and when I visited the page it still worked. Do you want me to try and do it now by cron or something?
Is there something else I could do that isn't PHP to actually see if cron jobs are actually working?! |
|
|
|
|
|