{"id":1014,"date":"2025-02-25T11:14:38","date_gmt":"2025-02-25T10:14:38","guid":{"rendered":"https:\/\/quanticalabs.com\/docs\/chauffeur-booking-system\/?post_type=lsvr_kba&#038;p=1014"},"modified":"2025-06-30T13:41:18","modified_gmt":"2025-06-30T11:41:18","slug":"cron-events-setup","status":"publish","type":"lsvr_kba","link":"https:\/\/quanticalabs.com\/docs\/chauffeur-booking-system\/knowledge-base\/cron-events-setup\/","title":{"rendered":"CRON Events Setup"},"content":{"rendered":"<p>CRON events are used in the Chauffeur Booking System plugin to automate tasks related to booking management at specific intervals. This includes actions such as sending reminders to customers and drivers before or after the service, as well as managing booking acceptance by drivers. In this article, we will guide you through how to add a CRON event in cPanel, configure it, and troubleshoot it.<\/p>\n<div class=\"tip\">\n<p><strong>Good to Know<\/strong><\/p>\n<p>For each option in the plugin that uses CRON commands, there is a CRON command provided \u2013 simply copy it and use it in your CRON configuration in cPanel.<\/p>\n<\/div>\n<h2>How to Add a CRON Command in cPanel<\/h2>\n<ol>\n<li>Log in to <strong>cPanel<\/strong> on your server.<\/li>\n<li>Navigate to the <mark>&#8216;Advanced&#8217;<\/mark> section and click on <mark>&#8216;Cron Jobs&#8217;<\/mark>.<\/li>\n<li>Choose the frequency with which you want the task to run (e.g., once per minute, twice per hour, daily, etc.).<\/li>\n<li>In the <mark>&#8216;Command&#8217;<\/mark> field, enter the command you want to execute. For example, it could be <strong>wget<\/strong>, which will trigger various actions related to your plugin.<\/li>\n<li>Click <mark>&#8216;Add New Cron Job&#8217;<\/mark>.<\/li>\n<\/ol>\n<h2>Basic CRON Command in Chauffeur Booking System Plugin<\/h2>\n<p>For the Chauffeur Booking System plugin, you can use the <strong>wget<\/strong> command to trigger a CRON event based on various actions in the system. A basic command looks like this:<\/p>\n<pre>wget \"https:\/\/yourdomain.com?chbs_cron_event=1&amp;chbs_run_code=B94965E464EB6637038B189F1735CCB0\"\r\n<\/pre>\n<p>In the command above:<\/p>\n<ul>\n<li><strong>yourdomain.com<\/strong> is the domain where your plugin is installed. You can replace it with your own domain.<\/li>\n<li><strong>chbs_cron_event<\/strong> is a parameter that defines the CRON event (e.g., <strong>1<\/strong> for the first event).<\/li>\n<li><strong>chbs_run_code<\/strong> is a unique code that identifies the specific task to be performed.<\/li>\n<\/ul>\n<p>Here is an example with three CRON events:<\/p>\n<pre>wget \"https:\/\/yourdomain.com?chbs_cron_event=1&amp;chbs_run_code=B94965E464EB6637038B189F1735CCB0\"\r\nwget \"https:\/\/yourdomain.com?chbs_cron_event=2&amp;chbs_run_code=B94965E464EB6637038B189F1735CCB0\"\r\nwget \"https:\/\/yourdomain.com?chbs_cron_event=3&amp;chbs_run_code=B94965E464EB6637038B189F1735CCB0\"\r\n<\/pre>\n<h2>How to Set the CRON Event Execution Time<\/h2>\n<p>Once you&#8217;ve added the command, you can set how often the event will execute by clicking <mark>&#8216;Edit&#8217;<\/mark> next to it.<\/p>\n<ul>\n<li><strong>Every minute<\/strong>: <code>* * * * *<\/code><\/li>\n<li><strong>Daily at 3:00 AM<\/strong>: <code>0 3 * * *<\/code><\/li>\n<li><strong>Every hour<\/strong>: <code>0 * * * *<\/code><\/li>\n<\/ul>\n<p>After setting the execution time, save your changes.<\/p>\n<h2>How to Modify the Command to Avoid Saving Output on the Server<\/h2>\n<p>If you want the CRON command to not save any data on the server (e.g., to avoid saving files), you can modify the command as follows:<\/p>\n<pre>wget -q -O \/dev\/null \"https:\/\/www.yourdomain.com?chbs_cron_event=1&amp;chbs_run_code=12323FD3D1CC7B416596F8E9FCF2DE23\" &gt;\/dev\/null 2&gt;&amp;1\r\n<\/pre>\n<p>In the command:<\/p>\n<ul>\n<li><strong><code>-q<\/code><\/strong> stands for <mark>&#8216;quiet mode&#8217;<\/mark>, which suppresses output messages.<\/li>\n<li><strong><code>-O \/dev\/null<\/code><\/strong> ensures that the downloaded file is discarded and not saved.<\/li>\n<li><strong><code>&gt;\/dev\/null 2&gt;&amp;1<\/code><\/strong> directs both standard output and errors to <strong>\/dev\/null<\/strong>, ensuring no logs are stored.<\/li>\n<\/ul>\n<p>This kind of command is useful when you don&#8217;t want to store any data on the server.<\/p>\n<div class=\"tip\">\n<p><strong>Good to Know<\/strong><\/p>\n<p>If the wget command doesn&#8217;t work as expected, or if you encounter any issues, try replacing wget with the full path to the command, which is typically <strong>\/usr\/bin\/wget<\/strong>. This ensures that the correct executable is used regardless of your server&#8217;s path configuration.<\/p>\n<\/div>\n<p>Example command:<\/p>\n<pre>\/usr\/bin\/wget -q -O \/dev\/null \"https:\/\/www.yourdomain.com?chbs_cron_event=1&amp;chbs_run_code=12323FD3D1CC7B416596F8E9FCF2DE23\" &gt;\/dev\/null 2&gt;&amp;1\r\n<\/pre>\n<h2>How to Check If &#8216;wget&#8217; Exists on the Server<\/h2>\n<p>Sometimes, you may want to ensure that <strong>wget<\/strong> is installed on your server. To do this, you can check as follows:<\/p>\n<ol>\n<li>Log in to cPanel.<\/li>\n<li>Go to <mark>&#8216;Cron Jobs&#8217;<\/mark>.<\/li>\n<li>Add a new CRON job with the following command:<\/li>\n<\/ol>\n<pre>which wget &gt; ~\/public_html\/wget_path.txt\r\n<\/pre>\n<ol start=\"4\">\n<li>Set the execution time to the closest option (e.g., every minute).<\/li>\n<li>After execution, check the contents of the <strong>wget_path.txt<\/strong> file by accessing it in the browser:<\/li>\n<\/ol>\n<pre>https:\/\/yourdomain.com\/wget_path.txt\r\n<\/pre>\n<p>If the file contains something like <strong>\/usr\/bin\/wget<\/strong>, it means <strong>wget<\/strong> is available at that location and can be used in CRON commands.<\/p>\n<h2>How to Debug the CRON Command and Check if It Runs Correctly<\/h2>\n<p>If you want to check whether your CRON command is executing correctly, you can debug it:<\/p>\n<ol>\n<li>Add a new CRON job with the following command to see what happens during execution:<\/li>\n<\/ol>\n<pre>\/usr\/bin\/wget --server-response -O - \"https:\/\/www.yourdomain.com?chbs_cron_event=1&amp;chbs_run_code=12323FD3D1CC7B416596F8E9FCF2DE23\" &gt;&gt; ~\/public_html\/cron_wget_log.txt 2&gt;&amp;1\r\n<\/pre>\n<ol start=\"2\">\n<li>Set the execution time to the closest option (e.g., every minute).<\/li>\n<li>After execution, open the log file in your browser:<\/li>\n<\/ol>\n<pre>https:\/\/yourdomain.com\/cron_wget_log.txt\r\n<\/pre>\n<p>If everything works correctly, you should see an HTTP server response (e.g., 200 OK).<\/p>\n<h2>Conclusion<\/h2>\n<p>Configuring and debugging CRON events in cPanel is relatively simple and allows you to automate various tasks in your booking system. By following these instructions, you can add a CRON command, customize it to your needs, and check if it&#8217;s working correctly. If you encounter any issues, remember to debug, check if <strong>wget<\/strong> is available, and log errors for further analysis.<\/p>\n<div class=\"doc-version\">\n<p><strong>Summary<\/strong><\/p>\n<p>Document version: 1.2<br \/>\nLast updated: June 30, 2025<br \/>\nPlugin version: 6.8+<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>CRON events are used in the Chauffeur Booking System plugin to automate tasks related to booking management at specific intervals. This includes actions such as sending reminders to customers and drivers before or after the service, as well as managing booking acceptance by drivers. In this article, we will guide you through how to add [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","template":"","format":"standard","meta":{"footnotes":""},"lsvr_kba_cat":[10],"lsvr_kba_tag":[],"_links":{"self":[{"href":"https:\/\/quanticalabs.com\/docs\/chauffeur-booking-system\/wp-json\/wp\/v2\/lsvr_kba\/1014"}],"collection":[{"href":"https:\/\/quanticalabs.com\/docs\/chauffeur-booking-system\/wp-json\/wp\/v2\/lsvr_kba"}],"about":[{"href":"https:\/\/quanticalabs.com\/docs\/chauffeur-booking-system\/wp-json\/wp\/v2\/types\/lsvr_kba"}],"author":[{"embeddable":true,"href":"https:\/\/quanticalabs.com\/docs\/chauffeur-booking-system\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/quanticalabs.com\/docs\/chauffeur-booking-system\/wp-json\/wp\/v2\/comments?post=1014"}],"version-history":[{"count":22,"href":"https:\/\/quanticalabs.com\/docs\/chauffeur-booking-system\/wp-json\/wp\/v2\/lsvr_kba\/1014\/revisions"}],"predecessor-version":[{"id":1117,"href":"https:\/\/quanticalabs.com\/docs\/chauffeur-booking-system\/wp-json\/wp\/v2\/lsvr_kba\/1014\/revisions\/1117"}],"wp:attachment":[{"href":"https:\/\/quanticalabs.com\/docs\/chauffeur-booking-system\/wp-json\/wp\/v2\/media?parent=1014"}],"wp:term":[{"taxonomy":"lsvr_kba_cat","embeddable":true,"href":"https:\/\/quanticalabs.com\/docs\/chauffeur-booking-system\/wp-json\/wp\/v2\/lsvr_kba_cat?post=1014"},{"taxonomy":"lsvr_kba_tag","embeddable":true,"href":"https:\/\/quanticalabs.com\/docs\/chauffeur-booking-system\/wp-json\/wp\/v2\/lsvr_kba_tag?post=1014"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}