Jump to content

Email throttling or Cron job using PHP


leo_maverick

Recommended Posts

 

Hi,

 

Can someone please help me with the command used to activate a

cron job from the server?

I heard from my friends that using 'lynx' was the easiest command, but I

assume the hosting server does not support as it shows no page or with no

result. Is there any other alternative to run a cron job?

 

Thank you

 

 

 

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/136028-email-throttling-or-cron-job-using-php/
Share on other sites

Crontab is a Linux function, your hosting provider should have information about it, or it should be in your control panel if it is available. If it is not available, then you can take a look at this other Post I made the other day about using WGET on a windows box with a scheduled task to mimic cron jobs.

 

http://www.phpfreaks.com/forums/index.php/topic,228060.msg1055681.html#msg1055681

 

Nate

I know that wget has nothing to do with cron. But used in the manner that I have shown it can "mimic" cron jobs when there is no actual crontab available.

 

The other poster needed to use windows scheduled task to run a php script. It would not run by just putting in a scheduled task pointing to the webpage, or to a browser and passing a webpage as an argument.

 

But since wget does what it does, you can use it to run a php script at a scheduled interval when crontab is not available.

 

I just thought that I would pass this along to original poster as it may be of help if his host does not make crontab available.

 

Nate

But used in the manner that I have shown it can "mimic" cron jobs when there is no actual crontab available.

 

wget does not mimic cron at all. Its simply makes http requests.

 

The other poster needed to use windows scheduled task to run a php script. It would not run by just putting in a scheduled task pointing to the webpage, or to a browser and passing a webpage as an argument.

 

PHP scripts executed via cron or windows scheduled task should be executed via php's cli, not the webserver.

 

PHP scripts executed via cron or windows scheduled task should be executed via php's cli, not the webserver.

 

I had mentioned that to the other poster and also stated that getting all modules to load that are needed can be a pain. I have tried to do that before and did not have a lot of luck with it. So upon doing some research I found wget for windows and combined with scheduled tasks, was able to schedule it to run at a particular time and execute a php script on the server thereby accomplishing what was needed.

 

Is it the best way, or a good way?? Maybe not, but it works.

 

Nate

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.