Task Scheduler
What is the task scheduler?
The task scheduler is a crucial cron job (scheduled task) that is responsible for all of the automatic processes from within FusionInvoice.
Some of these processes include:
- Emailing Recurring invoices
- Sending overdue notices
- Generating recurring invoices
These processes will not function unless the task scheduler cron job has been created.
*Cron jobs are specific to the Linux operating system. A Windows installation using Internet Information Services (IIS) as the webserver, will instead use Windows' Task Scheduler. In addition, depending on your webserver (Apache, Nginx, Litespeed, etc.) and the admin control panel that you used (cPanel, Plesk, CyberPanel, etc.) the steps for setting up cron jobs may differ.
How do I set up the task scheduler?
The cron job for the task scheduler should be set up to run once per day. Below is an example of how to create the cron job from an SSH command line to run the task scheduler every morning at 3am (change the hour as needed).
- From an SSH command line, enter the following command:
crontab -e
- When in the crontab editor, enter the following command and save the file:
0 3 * * * php /home/myfusionsite.com/public_html/artisan schedule:run >> /dev/null 2>&1
*IMPORTANT!
The method for running the daily tasks has changed with the 2024-3.0 release and it is likely that prior methods, using curl or wget will no longer work (depends on your webserver). In order to run the daily tasks now, you must use PHP to call the URL from your local installation, using the artisan command, which is included in the root site folder of the 2024-3.0 installation. (See the command referenced above.)
If you do not have SSH access and you use Godaddy or a similar company, you should have some type of account control panel from which cron jobs can be created. If this is the case but you are unsure of how to navigate the control panel to create the cron job then you will need to contact your web host or system administrator for assistance.
The following steps and configuration settings were shared by a FusionInvoice customer, running Plesk.
Plesk Obsidian 18.0.65
Ubuntu 24.04.1
PHP 8.2
- Tools and settings
- Under Tools & Resources>Scheduled Tasks
- Add Task
- Make sure cron is active and select “Run a PHP Script”
- Add script path /var/www/vhosts/DOMAIN/
Subdomain if placed in folder/artisan - Add arguments schedule:run
- Choose PHP version that Fusioninvoice is using 8.2/8.3
- Choose Run time (daily at 00:05) will run cron at 12:05pm
- Choose notify every time to check if cron is running
- Click apply
The Run Now button on the Plesk GUI does not seem to fire the daily task, just let the cron run on its own and don’t force it.