I found articles: https://docs.blesta.com/display/dev/Plugin+Cron+Tasks and https://docs.blesta.com/display/user/System+%3E+Automation#System>Automation-RunningtheCronManually and I see example code from /var/www/blesta/plugins/auto_cancel/auto_cancel_plugin.php . I don't want to run a job every day and don't want to bother with the install code for this.... I've got a plugin working via the web site, but need to run it from CLI (Command Line Interface).
I just want to create my own Linux Cron job that runs once a month, so I am wondering what I need for the command line [sudo crontab -e]:
@monthly "/usr/bin/php index.php /plugin/hourly/main/invoices/"
Sorry, I don't have direct access to the server to play with the path, or I wound not be asking how to do this. I've looked at the file /var/www/blesta/config/routes.php, but an stuck... It looks like the path may need to be something like: admin/api/plugin/hourly/main/invoices/ ? Any pointers on this?
Here is my /var/www/blesta/plugins/hourly/controllers/main.php controller file:
class Main extends HourlyController {
public function preAction() {
parent::preAction();
}
public function invoices() {
Loader::loadModels($this, array("Hourly.HourlyInvoice"));
$this->HourlyInvoice->start_invoices();
}
}