|
What is a cron job?
How do I create a cron job?
How do I set up the JForce support email cron job?
How do I set up the JForce reminder cron job?
What is a cron job?
Taken from Wikipedia: Cron is a time-based job scheduler in Unix-like computer operating systems. Cron enables users to schedule jobs (commands or shell scripts) to run periodically at certain times or dates. It is commonly used to automate system maintenance or administration, though its general-purpose nature means that it can be used for other purposes, such as connecting to the Internet and downloading email. Read more.
How do I create a cron job?
The process to create a cron job may vary depending on the company with which your website is hosted. If cPanel is not available on your website, you do not have access to create a cron job, or the steps below do not work for you then you should contact your hosting company for support.
If cPanel is available on your website then the following steps will allow you to set up a cron job with most hosts:
- Log into cPanel
- Scroll down to the Advanced section
- Select the "Cron jobs" link
- In the "Add New Cron Job" section, you will need to configure how often the cron job will run and the command to execute.
- After configuring the cron job, click the "Add new cron job" button.
- If configured correctly, your cron job is now activated. You can edit your cron jobs in the "Current Cron Jobs" section.
How do I set up the JForce support email cron job?
In order to have JForce check an email inbox and import the emails as tickets or replies to an existing ticket, you will need to create a cron job to run the checkSupportEmail task within JForce. When configuring the cron job, you will want to pick a time interval that will check emails quickly without putting a high load on your server. We recommend running the JForce support email cron job every two to five minutes. Two methods of setting up this cron job are outlined below.
Note: If php is located in a directory other than /usr/local/bin, you will need to contact your hosting company to find the correct path and replace /usr/local/bin/php with the path to php on your server.
Note: If cURL is located in a directory other than /user/bin, you will need to contact your hosting company to find the correct path and replace /usr/bin/curl with the path to cURL on your server.
Method I:
- Follow steps 1-4 in How do I create a cron job? above.
- In the Minute box, enter the number of minutes between email queries. We recommend keeping this number between 2 and 5.
- In the Hour box, enter "*" without the quotes
- In the Day box, enter "*" without the quotes
- In the Month box, enter "*" without the quotes
- In the Weekday box, enter "*" without the quotes
- In the Command box, enter "/usr/bin/curl http://www.yourwebsite.com/index.php?option=com_jforce&format=raw&tmpl=component&task=checkSupportEmail" without the quotes, replacing http://www.yourwebsite.com with the actual URL of your Joomla installation.
- Click the "Add New Cron Job" button.
Method II:
- Follow steps 1-4 in How do I create a cron job? above.
- In the Minute box, enter the number of minutes between email queries. We recommend keeping this number between 2 and 5.
- In the Hour box, enter "*" without the quotes
- In the Day box, enter "*" without the quotes
- In the Month box, enter "*" without the quotes
- In the Weekday box, enter "*" without the quotes
- In the Command box, enter "/usr/local/bin/php -q /PATH_TO_JOOMLA_ROOT/jforcepm/supportemail.php" without the quotes, replacing PATH_TO_JOOMLA_ROOT with the full path to the root of your Joomla! installation.
- In your Joomla! root directory, create a folder named jforcepm
- Inside the jforcepm directory, create a file named supportemail.php
- Open supportemail.php and paste in the code below, replacing http://www.yourwebsite.com with the actual URL of your Joomla installation. Click the "Add New Cron Job" button to save the cron job.
PATH_TO_JOOMLA_ROOT/jforcepm/supportemail.php
Show/Hidden php code<?php #!/usr/local/bin/php -q $url = "http://www.yourwebsite.com/index.php?option=com_jforce&format=raw&tmpl=component&task=checkSupportEmail"; $timeout = 5; $crl = curl_init($url); curl_exec($crl); curl_close($crl); ?>
How do I set up the JForce reminder cron job?
First, you must create a cron job to run the reminder task within JForce.
Note: If php is located in a directory other than /usr/local/bin, you will need to contact your hosting company to find the correct path and replace /usr/local/bin/php with the path to php on your server.
Note: If cURL is located in a directory other than /user/bin, you will need to contact your hosting company to find the correct path and replace /usr/bin/curl with the path to cURL on your server.
The methods outlined below are applicable on most servers. These instructions will send reminders daily at 8:00 AM.
Method I:
- Follow steps 1-4 in How do I create a cron job? above.
- In the Minute box, enter "0" without the quotes
- In the Hour box, enter "8" without the quotes
- In the Day box, enter "*" without the quotes
- In the Month box, enter "*" without the quotes
- In the Weekday box, enter "*" without the quotes
- In the Command box, enter "/usr/bin/curl http://www.yourwebsite.com/index.php?option=com_jforce&format=raw&tmpl=component&task=run&action=reminder" without the quotes, replacing http://www.yourwebsite.com with the actual URL of your Joomla installation.
- Click the "Add New Cron Job" button.
Method II:
- Follow steps 1-4 in How do I create a cron job? above.
- In the Minute box, enter the number of minutes between email queries. We recommend keeping this number between 2 and 5.
- In the Hour box, enter "*" without the quotes
- In the Day box, enter "*" without the quotes
- In the Month box, enter "*" without the quotes
- In the Weekday box, enter "*" without the quotes
- In the Command box, enter "/usr/local/bin/php -q /PATH_TO_JOOMLA_ROOT/jforcepm/reminder.php" without the quotes, replacing PATH_TO_JOOMLA_ROOT with the full path to the root of your Joomla! installation.
- In your Joomla! root directory, create a folder named jforcepm
- Inside the jforcepm directory, create a file named reminder.php
- Open reminder.php and paste in the following code, replacing http://www.yourwebsite.com with the actual URL of your Joomla installation. Click the "Add New Cron Job" button to save the cron job.
PATH_TO_JOOMLA_ROOT/jforcepm/reminder.php
Show/Hidden php code<?php #!/usr/local/bin/php -q $url = "http://www.yourwebsite.com/index.php?option=com_jforce&format=raw&tmpl=component&task=run&action=reminder"; $timeout = 5; $crl = curl_init($url); curl_exec($crl); curl_close($crl); ?>
|