{"id":27978,"date":"2026-03-04T19:38:54","date_gmt":"2026-03-04T17:38:54","guid":{"rendered":"https:\/\/www.cheops-technology.ch\/docs\/how-do-i-create-a-cron-job\/"},"modified":"2026-04-20T17:04:01","modified_gmt":"2026-04-20T15:04:01","password":"","slug":"how-do-i-create-a-cron-job","status":"publish","type":"docs","link":"https:\/\/www.cheops-technology.ch\/en\/docs\/how-do-i-create-a-cron-job\/","title":{"rendered":"How do I create a Cron Job?"},"content":{"rendered":"\n<p>How do I create a Cron Job?<\/p>\n\n<p>You can do great things with Cron stains:<\/p>\n\n<ul class=\"wp-block-list\">\n<li>Back up your databases automatically<\/li>\n\n\n\n<li>Generate your statistics and send them to you in PDF format by e-mail<\/li>\n\n\n\n<li>Clean up your forum every day at a specific time<\/li>\n\n\n\n<li>etc.<\/li>\n<\/ul>\n\n<p>In general, you&#8217;ll be able to schedule repeated tasks on your hosting with scripts.<\/p>\n\n<p>When you log in to your CPanel, you should find this at the bottom of the &#8220;Advanced&#8221; panel<\/p>\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/www.cheops-technology.ch\/wp-content\/uploads\/2026\/04\/image2022-11-9_14-51-28.png\" alt=\"\"\/><\/figure>\n\n<p>You will be taken to the main Cron interface as shown below:<\/p>\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/www.cheops-technology.ch\/wp-content\/uploads\/2026\/04\/image2022-11-9_14-52-43.png\" alt=\"\"\/><\/figure>\n\n<h1 class=\"wp-block-heading\" id=\"Commentcr&#xE9;erunetacheplanifi&#xE9;e&#xAB;CronJob&#xBB;?-Ajouterunemaildenotification\">Add a notification email<\/h1>\n\n<p>The <em>Cron Email <\/em>section of the interface lets you enter an e-mail address in the system to send notifications when your cron tasks are executed. To define an e-mail address, proceed as follows: <\/p>\n\n<ol class=\"wp-block-list\">\n<li>In the text field: <em>Email,<\/em> enter the email address to which you wish to receive notifications.<br\/><img decoding=\"async\" height=\"250\" src=\"https:\/\/support.dfi.ch\/download\/attachments\/3080307\/image2022-11-9_14-55-37.png?version=1&amp;modificationDate=1668002137000&amp;api=v2\" alt=\"\"\/><\/li>\n\n\n\n<li>Click on <em>.<\/em><\/li>\n<\/ol>\n\n<h1 class=\"wp-block-heading\" id=\"Commentcr&#xE9;erunetacheplanifi&#xE9;e&#xAB;CronJob&#xBB;?-Ajouterunet&#xE2;checron\">Add a cron job<\/h1>\n\n<p>To create a cron job, perform the following steps:<\/p>\n\n<ol class=\"wp-block-list\">\n<li>Select the frequency at which you wish to run the cron job from the appropriate menus, or enter values in the text boxes.<\/li>\n<\/ol>\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/support.dfi.ch\/download\/attachments\/3080307\/image2022-11-9_14-56-45.png?version=1&amp;modificationDate=1668002206000&amp;api=v2\" alt=\"\"\/><\/figure>\n\n<ul class=\"wp-block-list\">\n<li><em>Common settings<\/em> &#8211; This menu allows you to select a commonly used interval. The system allows you to configure the appropriate parameters, <em>minute,<\/em> <em>hour,<\/em> <em>day,<\/em> <em>month<\/em>, and <em>days of the week <\/em>in the text fields for you. <\/li>\n<\/ul>\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td class=\"has-text-align-left\" data-align=\"left\"><em>Please note:<\/em><em>If wildcards ( * ) and ranges confuse you, this menu is a great way to learn how to configure fields.<\/em><\/td><\/tr><\/tbody><\/table><\/figure>\n\n<ol class=\"wp-block-list\">\n<li><em>Minute &#8211; Use this menu to select the number of minutes between each cron job run, or the minute of each hour at which you wish to run the cron job.<\/em><\/li>\n\n\n\n<li><em>Hour<\/em> &#8211; Use this menu to select the number of hours between each time the cron job runs, or the time of day you wish to run the cron job.<\/li>\n\n\n\n<li><em>Day<\/em> &#8211; Use this menu to select the number of days between each cron job run, or the day of the month on which you wish to run the cron job.<\/li>\n\n\n\n<li><em>Month<\/em> &#8211; Use this menu to select the number of months between each time the cron job runs, or the month of the year in which you wish to run the cron job.<\/li>\n<\/ol>\n\n<ul class=\"wp-block-list\">\n<li><em>Weekday<\/em> &#8211; Use this menu to select the days of the week on which you wish to run the cron job.<\/li>\n<\/ul>\n\n<ol class=\"wp-block-list\">\n<li>In the &#8220;<em>command&#8221;<\/em> field<em>,<\/em> enter the command you want the system to execute.<\/li>\n<\/ol>\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td class=\"has-text-align-left\" data-align=\"left\">notes:Enter the absolute path to the command you wish to execute. For example, if you wish to run the public_html\/index.php file in your home directory, enter the following command: \/home\/user\/public_html\/index.php<br\/>To disable notifications for a specific cron job, add the following line to the command: &gt; \/ Dev \/ null 2&gt; &amp; 1 <br\/><\/td><\/tr><\/tbody><\/table><\/figure>\n\n<p><strong><u>Important information:<\/u><\/strong><\/p>\n\n<ol class=\"wp-block-list\">\n<li>You <strong>must<\/strong> specify parameters for <em>minute,<\/em> <em>hour,<\/em> <em>day,<\/em> <em>month,<\/em> <em>Weekday<\/em> and <em>command<\/em> text fields.<\/li>\n<\/ol>\n\n<ul class=\"wp-block-list\">\n<li>\n<ul class=\"wp-block-list\">\n<li>\n<ol class=\"wp-block-list\">\n<li>The interface displays a green tick icon ( <img decoding=\"async\" src=\"https:\/\/support.dfi.ch\/download\/attachments\/3080307\/image2016-8-19%2015%3A42%3A35.png?version=1&amp;modificationDate=1471614155000&amp;api=v2\" alt=\"\"\/>) next to each parameter you have set correctly.<\/li>\n\n\n\n<li>If you enter or select an invalid parameter, the interface displays a red warning icon (<img decoding=\"async\" src=\"https:\/\/support.dfi.ch\/download\/attachments\/3080307\/image2016-8-19%2015%3A42%3A43.png?version=1&amp;modificationDate=1471614163000&amp;api=v2\" alt=\"\"\/> ) next to it.<\/li>\n<\/ol>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n<ol class=\"wp-block-list\">\n<li>Be <strong>extremely<\/strong> careful when using the &#8220;rm&#8221; command in a cron job. If you don&#8217;t declare the right options, you could delete the data from your directory. <\/li>\n<\/ol>\n\n<ol class=\"wp-block-list\">\n<li>Click on <em>Add Cron Job.<\/em><\/li>\n<\/ol>\n\n<h1 class=\"wp-block-heading\" id=\"Commentcr&#xE9;erunetacheplanifi&#xE9;e&#xAB;CronJob&#xBB;?-Afficherlest&#xE2;chescronexistants\">Show existing cron jobs<\/h1>\n\n<p>The <em>actual Cron Jobs <\/em>table displays your existing cron jobs.<\/p>\n\n<h1 class=\"wp-block-heading\" id=\"Commentcr&#xE9;erunetacheplanifi&#xE9;e&#xAB;CronJob&#xBB;?-Modifierunet&#xE2;checron\">Modifying a cron job<\/h1>\n\n<p>To modify a cron job, perform the following steps:<\/p>\n\n<ol class=\"wp-block-list\">\n<li>Locate the cron job you wish to modify and click on <em>Modify<\/em>.<\/li>\n\n\n\n<li>Modify the parameters you wish to change and click on <em>Modify<\/em> <em>line.<\/em><\/li>\n<\/ol>\n\n<h1 class=\"wp-block-heading\" id=\"Commentcr&#xE9;erunetacheplanifi&#xE9;e&#xAB;CronJob&#xBB;?-Supprimerunet&#xE2;checron\">Delete a cron job<\/h1>\n\n<p>To delete a cron job, perform the following steps:<\/p>\n\n<ol class=\"wp-block-list\">\n<li>Click <em>Delete<\/em> next to the cron job you wish to delete.<\/li>\n\n\n\n<li>Click on <em>Delete.<\/em><\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>How do I create a Cron Job? You can do great things with Cron stains: In general, you&#8217;ll be able to schedule repeated tasks on your hosting with scripts. When you log in to your CPanel, you should find this at the bottom of the &#8220;Advanced&#8221; panel You will be taken to the main Cron [&hellip;]<\/p>\n","protected":false},"author":6,"featured_media":29921,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"doc_category":[136],"doc_tag":[],"class_list":["post-27978","docs","type-docs","status-publish","has-post-thumbnail","hentry","doc_category-web-hosting"],"year_month":"2026-05","word_count":612,"total_views":0,"reactions":{"happy":0,"normal":0,"sad":0},"author_info":{"name":"Support","author_nicename":"support","author_url":"https:\/\/www.cheops-technology.ch\/en\/author\/support\/"},"doc_category_info":[{"term_name":"Web hosting","term_url":"https:\/\/www.cheops-technology.ch\/en\/docs-category\/web-hosting\/"}],"doc_tag_info":[],"_links":{"self":[{"href":"https:\/\/www.cheops-technology.ch\/en\/wp-json\/wp\/v2\/docs\/27978","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.cheops-technology.ch\/en\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/www.cheops-technology.ch\/en\/wp-json\/wp\/v2\/types\/docs"}],"author":[{"embeddable":true,"href":"https:\/\/www.cheops-technology.ch\/en\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/www.cheops-technology.ch\/en\/wp-json\/wp\/v2\/comments?post=27978"}],"version-history":[{"count":3,"href":"https:\/\/www.cheops-technology.ch\/en\/wp-json\/wp\/v2\/docs\/27978\/revisions"}],"predecessor-version":[{"id":29927,"href":"https:\/\/www.cheops-technology.ch\/en\/wp-json\/wp\/v2\/docs\/27978\/revisions\/29927"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.cheops-technology.ch\/en\/wp-json\/wp\/v2\/media\/29921"}],"wp:attachment":[{"href":"https:\/\/www.cheops-technology.ch\/en\/wp-json\/wp\/v2\/media?parent=27978"}],"wp:term":[{"taxonomy":"doc_category","embeddable":true,"href":"https:\/\/www.cheops-technology.ch\/en\/wp-json\/wp\/v2\/doc_category?post=27978"},{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/www.cheops-technology.ch\/en\/wp-json\/wp\/v2\/doc_tag?post=27978"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}