{"id":336,"date":"2023-02-27T08:47:05","date_gmt":"2023-02-27T08:47:05","guid":{"rendered":"https:\/\/blog.trustedhosting.in\/?p=336"},"modified":"2023-02-27T08:47:05","modified_gmt":"2023-02-27T08:47:05","slug":"cron-jobs-cpanel","status":"publish","type":"post","link":"https:\/\/www.webystrata.com\/blog\/cron-jobs-cpanel\/","title":{"rendered":"Cron Jobs &#8211; cPanel"},"content":{"rendered":"<p>If you want to run a command or a\u00a0<strong>php program<\/strong>\u00a0on a specified time interval like once a day or once a week, you can setup cron jobs in this interface.\u00a0<strong>Cron jobs<\/strong>\u00a0allow you to run a specific command or program automatically. This is often required, if you are using a software like CRM or Billing Software. Setting up cron jobs more often may degrade your server\u2019s performance.<\/p>\n<h2>Setup Cron Job<\/h2>\n<p>To add a new cron job, follow these steps \u2212<\/p>\n<p><strong>Step 1<\/strong>\u00a0\u2212 Open Cron Jobs by clicking Cron Jobs found in the Advanced section in cPanel.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/manage.trustedhosting.in\/index.php?rp=\/images\/kb\/122_cron-1.png\" alt=\"Cron\" width=\"1000\" height=\"460\" \/><\/p>\n<p><strong>Step 2<\/strong>\u00a0\u2212 Scroll down to see Add New Cron Job interface.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/manage.trustedhosting.in\/index.php?rp=\/images\/kb\/123_cron-2-th.png\" alt=\"Cron Job\" width=\"1000\" height=\"453\" \/><\/p>\n<p><strong>Step 3<\/strong>\u00a0\u2212 You can choose an existing setting from common settings. If you do that all the fields of cron execution time will automatically get filled. Or you can choose your custom runtime settings by specifying in the next text inputs accordingly.<\/p>\n<p><strong>Step 4<\/strong>\u00a0\u2212 Enter your command to run in cron job. If you are running a php file, enter full name of php file. For example \u2212<\/p>\n<pre class=\"result notranslate\">php \/home\/trusetdhosting\/public_html\/cron.php\r\n<\/pre>\n<p><strong>Step 5<\/strong>\u00a0\u2212 Click Add New Cron Job button to add a cron job.<\/p>\n<h2>Cron Email<\/h2>\n<p>cPanel by default sends an email each time a cron job runs. It also redirects the output of the command or file into the email. Default email for this is your system account, but you can change this email too. To change the email on which you want to receive cron email, firstly find out Cron Email interface in Cron Jobs. Then enter your new email in which you wish to get cron emails. Click Update email to update your email.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/manage.trustedhosting.in\/index.php?rp=\/images\/kb\/124_cron-3.png\" alt=\"Cron Email\" width=\"1000\" height=\"446\" \/><\/p>\n<p>If your cron runs more frequently, then you may not want to receive emails, you can disable receiving emails by redirecting your output into null by writing &gt;\/dev\/null 2&gt;&amp;1 at the end of the command. For example \u2212<\/p>\n<pre class=\"result notranslate\">php \/home\/trusetdhosting\/public_html\/cron.php &gt;\/dev\/null 2&gt;&amp;1\r\n<\/pre>\n<h2>Edit or Delete Existing Cron Jobs<\/h2>\n<p>To edit or delete your existing cron jobs, you can scroll below on the Corn Jobs interface to see current cron jobs. Once you select the job, you can click either the delete link or the edit link to edit or delete a particular cron job.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/manage.trustedhosting.in\/index.php?rp=\/images\/kb\/125_cron-4-th.png\" alt=\"Current Cron Jobs\" width=\"1002\" height=\"126\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you want to run a command or a\u00a0php program\u00a0on a specified time interval like once a day or once&hellip;<\/p>\n","protected":false},"author":1,"featured_media":337,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[12],"class_list":["post-336","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cpanel-complete-tutorials","tag-cpanel-complete-tutorials"],"_links":{"self":[{"href":"https:\/\/www.webystrata.com\/blog\/wp-json\/wp\/v2\/posts\/336","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.webystrata.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.webystrata.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.webystrata.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.webystrata.com\/blog\/wp-json\/wp\/v2\/comments?post=336"}],"version-history":[{"count":2,"href":"https:\/\/www.webystrata.com\/blog\/wp-json\/wp\/v2\/posts\/336\/revisions"}],"predecessor-version":[{"id":339,"href":"https:\/\/www.webystrata.com\/blog\/wp-json\/wp\/v2\/posts\/336\/revisions\/339"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.webystrata.com\/blog\/wp-json\/wp\/v2\/media\/337"}],"wp:attachment":[{"href":"https:\/\/www.webystrata.com\/blog\/wp-json\/wp\/v2\/media?parent=336"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.webystrata.com\/blog\/wp-json\/wp\/v2\/categories?post=336"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.webystrata.com\/blog\/wp-json\/wp\/v2\/tags?post=336"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}