January 12, 2018 at 7:10 pm #11242
I have a question concerning cronjobs… The invoiceninja docs say
“Create a cron to call the ninja:send-invoices and ninja:send-reminders commands once daily.”
0 8 * * * /usr/local/bin/php /path/to/ninja/artisan ninja:send-invoices 0 8 * * * /usr/local/bin/php /path/to/ninja/artisan ninja:send-reminders
What exactly does “/path/to/ninja/artisan” mean?
I cannot find a folder named artisan within the invoiceninja root or the /ninja subfolder.
I am running invoiceninja on a centOS 7 server with plesk.
What can I do?
Thanks very much,
TimoJanuary 12, 2018 at 7:23 pm #11243
artisan is a PHP file in the invoiceninja rootJanuary 12, 2018 at 8:46 pm #11245
zotya’s got it. You’re essentially just running
php artisan ninja:send-invoices(or
send-reminders). The rest is just telling the system where to find the things you want to run.
So by default, you’d be looking at something like
0 8 * * * /usr/local/bin/php /var/www/ninja/artisan ninja:send-invoices 0 8 * * * /usr/local/bin/php /var/www/ninja/artisan ninja:send-reminders
and it would run those two tasks at 8am every day.January 13, 2018 at 7:13 am #11246
Thanks very much… now it works!July 24, 2019 at 5:06 pm #21411
I’m having issues with the Cron task too, same configuration as here, CentOS + Plesk
I must be missing something here, could you detail how to get this command to run ?
I’m trying to run a command as follows from plesk interface, but I keep getting either file not found or command not found when trying to execute it.
Could you tell me how you managed to do it ?
indeed i connote fin any /usr/local/bin/php file or directory on the site root nor server root…
thanks in advance for your kind help
Robin.July 24, 2019 at 5:06 pm #21412July 24, 2019 at 9:24 pm #21413
From the images you provided, it looks like the system is doing a guided setup of a cron, in which case using the actual syntax won’t work. It seems to be having an issue because it doesn’t recognize the schedule portion of the cron, as it’s expecting just a simple command. It will probably ask you when you want the command to run on a different screen.
Also, be sure you’re using the actual PHP path for your particular setup. There’s always a chance it’s located somewhere other than
/user/local/bin.July 25, 2019 at 9:42 am #21416
Thanks for you reply.
yes indeed it’s the Plesk UI to create cron tasks, that i tried after trying the command via SSH… unsuccessfully.
I guess the problem is indeed the PHP path, i’ve check manually and I don’t have anything PHP on this user folder or site root folder.
just found that documentation below, I guess this is the path I have to insert :
not sure about which php version i should specify tho…
On Linux :
In Plesk for Linux, the PHP binary (the php file) is located in the following path:
Here <PHP version> should be replaced with a particular PHP version number.
For example, if your domain uses PHP version 7.0, use the following command to run the my_script.php script:
_________July 25, 2019 at 2:33 pm #21417
:: UPDATE ::
Ok I apparently managed to specify the good paths for both Artisan and the command, but still an error, this one below :
PHP Parse error: syntax error, unexpected ‘$value’ (T_VARIABLE) in /var/www/vhosts/musasabi.me/manage.musasabi.me/ninja/vendor/aws/aws-sdk-php/src/functions.php on line 36July 25, 2019 at 7:31 pm #21418
PHP version should be 7.0, 7.1, or 7.2 (they don’t support 7.3 yet, IIRC). For future reference (seeing as you have console access), using
which phpwill give you the path to your PHP binary.
php -vwill tell you what version your system is running.July 26, 2019 at 12:29 pm #21421
Thanks for the hints Titanfail, it’s now solved !
via the graphic interface of plesk, go to :
Domains, click on your domain name, then click on Scheduled tasks on the right side, then Run PHP command, then select path of artisan, and type in the command to execute (ninja:send-invoices)
Select the PHP version of the task (that’s where I had the last PHP parse error)
Save and Execute the cron task.
Repeat for the second task, ninja:send-reminders.
You must be logged in to reply to this topic.