Skip to content

Running the Forkiva Schedule ​

Forkiva uses Laravel’s Task Scheduler to automatically perform background operations such as generating reports, sending emails, and maintaining system data.
To keep your system running smoothly, you must make sure the schedule runs automatically every minute.

This guide explains how to properly configure and run the Forkiva scheduler on both VPS servers and Shared Hosting.

What Is the Forkiva Scheduler? ​

The scheduler is a background process that triggers all time-based system tasks automatically. To make this work, your server needs to call the following Laravel command every minute:

bash
php artisan schedule:run

If you have your Forkiva project installed on a VPS or cloud server (such as AWS, DigitalOcean, or Vultr) with SSH access, use this setup for best performance and reliability.

Step 1: Connect to Your Server ​

Open an SSH connection using your credentials:

bash
ssh username@your-server-ip

(Replace username and your-server-ip with your actual credentials.)

Step 2: Open the Crontab ​

Once connected, open the cron configuration file:

bash
crontab -e

Step 3: Add the Forkiva Scheduler Command ​

At the end of the file, add the following line:

bash
* * * * * cd /var/www/forkiva && php artisan schedule:run >> /dev/null 2>&1

⚠️ Important: Replace /var/www/forkiva with the full path to your Forkiva project.

Explanation ​

PartDescription
* * * * *Runs the command every minute.
cd /var/www/forkivaMoves into your Forkiva project directory.
php artisan schedule:runExecutes the Laravel scheduler.
>> /dev/null 2>&1Hides output from logs (optional but recommended).

Step 4: Save and Verify ​

After saving, confirm your cron job is active:

bash
crontab -l

Then, wait a few minutes and check if the tasks are running:

bash
tail -f storage/logs/laravel.log

You should see logs similar to:

Running scheduled command: App\Console\Commands\SyncReports

Running the Scheduler on Shared Hosting ​

If you’re hosting Forkiva on a shared hosting platform (like cPanel, Plesk, or DirectAdmin), you can configure the scheduler using your control panel.

Step 1: Find Your Project Path ​

Locate your Forkiva project directory path — typically one of the following:

/home/username/public_html
/home/username/public_html/forkiva
/home/username/forkiva

Tip: You can confirm this path inside your cPanel File Manager.

Step 2: Create a Cron Job in cPanel ​

  1. Log in to your cPanel or hosting dashboard.
  2. Go to Advanced → Cron Jobs.
  3. Under Add New Cron Job, select Every Minute for all time fields.
  4. In the Command field, paste the following:
bash
cd /home/username/public_html/forkiva && /usr/local/bin/php artisan schedule:run >> /dev/null 2>&1

🟢 Note: The PHP path may vary depending on your hosting provider.
You can check it by running:

bash
which php

Common paths include:

  • /usr/bin/php
  • /usr/local/bin/php
  • /opt/alt/php82/usr/bin/php

Step 3: Save and Test ​

After saving, cPanel will automatically execute your cron job every minute.
To verify it’s working, open your Forkiva logs:

bash
storage/logs/laravel.log

You should see scheduled task entries appear within a few minutes.

Test the Scheduler Manually ​

If you want to test the scheduler manually, run this command from your Forkiva project root:

bash
php artisan schedule:run

You should see output like:

Running scheduled command: App\Console\Commands\ForkivaSync

Best Practices ​

  • Run Every Minute: Forkiva’s scheduler internally manages all timings — so you only need one cron job running per minute.
  • Use Absolute Paths: Always include full paths in your cron command.
  • Match PHP Version: Use the same PHP binary version as your Forkiva app.
  • Suppress Output: Use >> /dev/null 2>&1 to keep cron logs clean.
  • Monitor Logs: Regularly check storage/logs/laravel.log to ensure tasks are running successfully.

Example for Multiple Forkiva Projects ​

If you manage multiple Forkiva environments (like staging and production), add separate cron jobs for each:

bash
* * * * * cd /home/user/forkiva-staging && php artisan schedule:run >> /dev/null 2>&1
* * * * * cd /home/user/forkiva-production && php artisan schedule:run >> /dev/null 2>&1

Summary ​

EnvironmentCommandWhere to Configure
VPS Server* * * * * cd /var/www/forkiva && php artisan schedule:run >> /dev/null 2>&1Via SSH → crontab -e
Shared Hostingcd /home/username/public_html/forkiva && /usr/local/bin/php artisan schedule:run >> /dev/null 2>&1Via cPanel → Cron Jobs

Troubleshooting ​

IssueSolution
Tasks not runningEnsure cron is set to run every minute and points to the correct Forkiva path.
“php: command not found”Use the full PHP binary path (e.g., /usr/local/bin/php).
Permission deniedCheck directory permissions and user access.
Log not updatingRun chmod 775 -R storage/logs to fix permissions.

Tenvoro