Automated Tasks (CRON Jobs)

A cron job is a standard web server feature that runs commands on a schedule. Your BeDesk installation requires a cron job to handle automated tasks like sending email notifications, turning emails into tickets, closing abandoned chats and performing system maintenance.

Setting this up is a crucial one-time step to ensure your helpdesk runs smoothly.

The Cron Command

You'll need to set up a cron job that runs every minute.

It's crucial that the main CRON command runs every minute. BeDesk internally schedules all the other commands using this one, so you don't have to register multiple CRON commands manually. If this main command does not run every minute, other commands might not get called at all.

Here is the command you will need to use. Copy it and be ready to paste it into your hosting control panel.

/usr/local/bin/php /path/to/your/bedesk/artisan schedule:run >> /dev/null 2>&1

Important Steps

  1. Change the Path: You must replace /path/to/your/bedesk/ with the full, absolute path to the directory where you installed BeDesk. Your hosting provider can help you find this path if you're unsure.

  2. PHP Version: The command uses a common path for PHP (/usr/local/bin/php). If that doesn't work, try using just php instead:

php /path/to/your/bedesk/artisan schedule:run >> /dev/null 2>&1

What does >> /dev/null 2>&1 do? This part of the command prevents you from receiving an email notification every single minute the command runs. It's recommended to keep it.

Example: cPanel

cPanel is a popular hosting control panel. Here’s how to set up the cron job there.

  1. Log in to your cPanel and find the Cron Jobs tool.

  2. Under the "Add New Cron Job" section, select "Once Per Minute" from the "Common Settings" dropdown menu. This will automatically fill in the schedule (* * * * *).

  3. In the Command field, paste the full command with your corrected path.

  4. Click Add New Cron Job.

Here is an example of what the completed form should look like. The path in this example is /home/tjh1oger0bl6/public_html/.

cPanel Cron Job settings interface

The final command would be:

/usr/local/bin/php /home/tjh1oger0bl6/public_html/artisan schedule:run >> /dev/null 2>&1

Example: Plesk

Plesk is another common control panel. The steps are slightly different.

  1. Log into your Plesk panel and navigate to the Scheduled Tasks menu on the right sidebar.

  2. Click Add Task.

  3. Set the Task Type to "Run a command".

  4. In the Command field, paste the full command with your corrected path.

  5. For the schedule, select "Cron style" and enter * * * * * into the box.

  6. Click OK to save the task.

Plesk Scheduled Tasks settings interface

How to Verify It's Working

You can check if CRON commands are running from Admin > Logs > Scheduled Commands page. Wait at least a minute before checking the log after adding CRON job on your sever.

If your cron job command does not include >> /dev/null 2>&1, you might receive an email every minute. If the email contains the message "No scheduled commands are ready to run.", this is a good sign. It means the cron job is executing successfully, but there were no tasks for it to process at that specific time.