Jump to content

Recommended Posts

Posted

Hi

 

I`m new in theme of hosting. In the university give me the one job to make a web page in php to a client (xxx) external for the university. This web pages have some services that a client (yyy) of client(xxx) ask to do so.

 

Every 30 mins it has to see for the clients of client(xxx) that have any kind of service between the next 30 min. If in the next 30 min are 2 services for 2 clients, it will have to send a mail to remember then that they have something to do in the next 30 min.

 

The client(xxx) have to aquire a hosting, but until the php code is done, and im not as well in money to have my own web hosting, so that´s why im grateful with you que you can give me a free one with cpanel stuff to try arround.

 

I´ve make 1 cronjob that works every 5 min just to try if it works, but i cant get that that cronjob work.

 

Then i deleted and try again with something different, but not.

 

The php im trying to use its named index.php in the /public_html

 

I have tried in the command line use this path´s:

/usr/local/bin/php -q /home/ajeche/public_html/index.php

/public_html/index.php

 

Are they ok?

 

If i go to the page it sends me an email, no post, no get needed, its to try only. But in cron jobs, do nothing.

 

Sorry for my bad english, I hope that you undestand what im trying to say.

 

Thanks for the free hosting ;)

Posted

Assuming a single job, that job can't run more than once every 12 hours. Trying to run more will just get you suspended.

 

As for the commands, I'll need to check them when I'm on a PC later unless someone else responds with the answer.

  • Like 1
Posted

This is what you use for cron command:

 

Sends email:

php -q /home/ajeche/public_html/index.php

 

No email:

php -q /home/ajeche/public_html/index.php >/dev/null 2>&1

  • Like 1
Posted

Hi again :)

 

Thanks for both answers.

 

I´ll try tomorrow to avoid suspending.

 

Have a nice evening (i thing its evening right there), and weekend.

Posted
This is what you use for cron command: Sends email:
php -q /home/ajeche/public_html/index.php

No email:

php -q /home/ajeche/public_html/index.php >/dev/null 2>&1

 

Good night.

 

I´ve tried to mea the cron job with the "php -q /home/ajeche/public_html/index.php" like you told me, but i cant get the email.

 

The email its to me, from me.

 

The strange thing is that the cron job does not give me any mail, by any of the 2 ways, the way of just running the command "php -q /home/ajeche/public_html/index.php", or the way of that the cron job sent me any message after the job is completed.

 

I´m asking, does the cron jobs for my user may be posible disabled?.

 

if you look my site "ajeche.heliohost.org", it automatically sent me a message, the code used is very simple:

 

<?php
$message = "The message. \r \n
 New line ";
 $headers = "From: ajeche@ajeche.heliohost.org";
 $To = "ajeche@ajeche.heliohost.org";
 $about = "Testing";
 mail($To, $about, $message, $headers);

return "ok";
?>

 

Good night :)

Posted

Is your cron job completed when it's run. Is index.php being executed?

 

Try a different email address instead of your heliohost email.

Posted
Is your cron job completed when it's run. Is index.php being executed? Try a different email address instead of your heliohost email.

 

I´m sorry.

 

I´ve tried distinct ways, and no results. Then I quit the cron job.

 

Later, too later I became recive multiple mails.

 

The way that I make to function the cron job is:

*/5 * * * * wget ajeche.heliohost.org

 

It takes hours, i think for the load at the server, and I apologize for my mistake, but if someone ask you another way to do it if it does not work normally, thats the one that I think worked for me. I say I think, because, I dont know if that is the one that worked but i beleve it at 99%.

Posted

Running the job that way is going to get you suspended. It should not run more often than once every 12 hours. Every 5 minutes is not permitted. And yes, server load can cause them to be slow, especially on Johnny.

Posted
Running the job that way is going to get you suspended. It should not run more often than once every 12 hours. Every 5 minutes is not permitted. And yes, server load can cause them to be slow, especially on Johnny.

 

Im sorry.

 

My wish was not to overcharge the server. It was so see if in the next 10 minutes i get the 2 mails (the two run cron jobs), and quit it.

 

Now i know that it can takes a while to run it.

 

I´m gonna take it in mind.

 

Thanks for your support, and have a nice day :)

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...