N
N
NataliaCh2016-02-25 11:17:29
PHP
NataliaCh, 2016-02-25 11:17:29

How to automate cron launch?

There is a mailing script for subscribers. According to the terms of hosting, the mailing list should be limited by the number of emails sent per day and spread over time. As a result, the mailing script works according to the cron, taking into account the requirements. Everything is fine, except that you need to enable cron script launch on the server every time before sending, and turn it off after the mailing is over. Because the mailing is done no more than once a month and there is no point in the rest of the time to work out the script regularly once an hour.
Is it possible to somehow initiate the launch of a script by cron from a php script? The "send newsletter" button enables cron launch. The distribution is over - the cron launch is disabled.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Andrey, 2016-02-25
@VladimirAndreev

and even read on Wikipedia about the options for setting up the crontab, so that the script runs once a month, if that's what you need...

M
Max, 2016-02-25
@MaxDukov

OMG...
add to the script a check of some flag in the form of a file / entry in the database / something else. And put this flag out of the web muzzle.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question