Cron Configuration
Cron is a time-based job scheduler in Unix-like operating systems. It allows users to schedule jobs
(commands or scripts) to run at specific intervals or times. In the context of Text Club, setting up
cron jobs is essential for automating tasks such as sending scheduled messages, processing incoming messages, and performing regular maintenance tasks.
To access the cron configuration page, navigate to:
Follow the steps below to set up cron jobs for Text Club:
- Determine the installation path of PHP on your server. The default value of
/usr/local/bin/php
is pretty sufficient for most installations. If you are unsure of your server's PHP installation path, you can find it by running the following command in your terminal:which php
- Enter the
php installation path
obtained in step 1 into thePHP Path
input box - Click the
Submit
button at the bottom of the page to save your changes
Add the Cron Job
Next you will add the cron to your server's crontab. Follow the steps below to add the cron job:
To get the cron job url, navigate to:
- Copy the
Cron URL
- On CPanel, search for
cron
and click on theCron Jobs
icon. -
In the
Add New Cron Job
section, select the desired time interval for the cron job to run. It is recommended to set the cron to run every 1 minute. If you want the cron job to run every 5 minutes, selectEvery 5 Minutes
from the dropdown menu. -
In the
Command
field, enter the following command, replacingYOUR_CRON_URL
with the cron URL you copied in step 1. -
Click the
Add New Cron Job
button to save the cron job. - You should see a confirmation message indicating that the cron job has been added successfully.
-
You can verify that the cron job is working by checking the
Cron Reports
page in Text Club. This page will show you the status of the cron job and any errors that may have occurred. - If you encounter any issues with the cron job, check the server logs for any error messages. You can also try running the cron job manually by entering the command in your terminal.
- If you are using a different hosting provider, the steps to add a cron job may vary. Check your hosting provider's documentation for specific instructions on how to add a cron job.
-
If you are using a VPS or dedicated server, you can add the cron job directly to the crontab
file by running the following command in your terminal:
crontab -e
This will open the crontab file in your default text editor. Add the cron job command to the file and save it.