{"id":91,"date":"2025-12-28T20:41:18","date_gmt":"2025-12-28T19:41:18","guid":{"rendered":"https:\/\/mybox.com\/help\/?post_type=manual_kb&#038;p=91"},"modified":"2026-04-02T10:17:19","modified_gmt":"2026-04-02T08:17:19","slug":"add-a-new-cron-job","status":"publish","type":"manual_kb","link":"https:\/\/mybox.com\/help\/en\/knowledgebase\/add-a-new-cron-job\/","title":{"rendered":"Add a new CRON job"},"content":{"rendered":"\n<div class=\"translation-block translation-block-merged\">\n<p class=\"wp-block-paragraph\">A CRON job is a time-based task scheduler that allows you to automate repetitive actions on your server, such as backing up databases, sending scheduled emails, or clearing cache files.<\/p>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_86 ez-toc-wrap-left counter-hierarchy ez-toc-counter ez-toc-custom ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/mybox.com\/help\/en\/knowledgebase\/add-a-new-cron-job\/#Context\" >Context<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/mybox.com\/help\/en\/knowledgebase\/add-a-new-cron-job\/#Step-by-Step_Configuration\" >Step-by-Step Configuration<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/mybox.com\/help\/en\/knowledgebase\/add-a-new-cron-job\/#Distinction_Local_Path_vs_Working_Directory\" >Distinction: Local Path vs. Working Directory<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/mybox.com\/help\/en\/knowledgebase\/add-a-new-cron-job\/#Practical_Implications\" >Practical Implications<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/mybox.com\/help\/en\/knowledgebase\/add-a-new-cron-job\/#Summary\" >Summary<\/a><\/li><\/ul><\/nav><\/div>\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Context\"><\/span>Context<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Automating tasks through the <strong>mybox panel<\/strong> ensures that essential maintenance or application logic runs at specific intervals without manual intervention. Because CRON jobs consume server resources, they are executed within &#8220;Profiles&#8221; that manage their impact on your environment&#8217;s performance.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Step-by-Step_Configuration\"><\/span>Step-by-Step Configuration<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<\/div>\n\n<div id=\"mybox-2176942092\" class=\"mybox-content mybox-entity-placement\"><div class=\"early-access-banner-inpost\">\r\n  <div class=\"banner-left-inpost\">\r\n    <div class=\"icon-box-inpost\">\r\n      <img decoding=\"async\" src=\"https:\/\/mybox.com\/help\/wp-content\/uploads\/2026\/02\/square-info-icon.svg\" alt=\"Info\">\r\n    <\/div>\r\n    <div class=\"text-box-inpost\">\r\n      <span class=\"label-inpost\"><span class=\"translation-block translation-block-banner-text\">Early access<\/span><\/span>\r\n      <h4><span class=\"translation-block translation-block-banner-text\">Still need help?<\/span><\/h4>\r\n      <p><span class=\"translation-block translation-block-banner-text\">Contact our customer service team.<\/span><\/p>\r\n    <\/div>\r\n  <\/div>\r\n\r\n  <div class=\"banner-right-inpost\">\r\n    <a href=\"https:\/\/panel.mybox.com\/helpdesk2\/v\/list\/\" class=\"banner-button-inpost\"><span class=\"translation-block translation-block-banner-text\">Message us<\/span><\/a>\r\n  <\/div>\r\n<\/div><\/div>\n\n<div class=\"translation-block translation-block-merged\"><p class=\"wp-block-paragraph\">To set up a new automated task:<\/p>\n\n\n\n<ol start=\"1\" class=\"wp-block-list\">\n<li><strong>Access CRON Menu:<\/strong> Log in to the <strong>mybox panel<\/strong>, navigate to the <strong>Additional Services<\/strong> menu, and select <strong>CRON Tasks<\/strong>.<\/li>\n\n\n\n<li><strong>Add Task:<\/strong> Click the <strong>Add<\/strong> button in the top menu to open the task configuration form.<br><\/div>\n\n<img decoding=\"async\" src=\"https:\/\/mybox.com\/help\/wp-content\/uploads\/2025\/12\/image-4.png\" alt=\"\">\n\n<div class=\"translation-block translation-block-merged\"><\/li>\n\n\n\n<li><strong>Select a Profile:<\/strong> Choose an execution profile. This defines the CPU limits, RAM allocation, and maximum execution time for the task.<\/li>\n\n\n\n<li><strong>Choose the Program:<\/strong> Select the application that will execute your task (e.g., PHP, Python, or a Bash shell script).<\/li>\n\n\n\n<li><strong>Define the Path:<\/strong> * <strong>Local files:<\/strong> Enter the relative path starting from your home directory (e.g., <code>~\/scripts\/backup.php<\/code>).\n<ul class=\"wp-block-list\">\n<li><strong>Remote resources:<\/strong> Enter the full URL if the task involves retrieving a remote file.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Set the Working Directory:<\/strong> This is the default folder the program will &#8220;stand in&#8221; while running. If your script tries to open <code>data.txt<\/code> without a full path, the server will look for it here.<\/li>\n\n\n\n<li><strong>Select the Interval:<\/strong> Choose how often the task should run (e.g., every hour, daily, or at a custom crontab frequency).<br><\/div>\n\n<img decoding=\"async\" src=\"https:\/\/mybox.com\/help\/wp-content\/uploads\/2025\/12\/image-3.png\" alt=\"\">\n\n<div class=\"translation-block translation-block-merged\"><\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Distinction_Local_Path_vs_Working_Directory\"><\/span>Distinction: Local Path vs. Working Directory<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Path:<\/strong> The exact location of the script file you want to run.<\/li>\n\n\n\n<li><strong>Working Directory:<\/strong> The &#8220;context&#8221; folder. If your script saves a file named <code>report.pdf<\/code>, it will be placed inside this directory unless a different absolute path is specified in the code.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Practical_Implications\"><\/span>Practical Implications<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Resource Management:<\/strong> If a task exceeds the limits defined in its <strong>Profile<\/strong>, the system will terminate it to protect the stability of your other services.<\/li>\n\n\n\n<li><strong>Relative Paths (<code>~\/<\/code>):<\/strong> Always remember that <code>~\/<\/code> represents your account&#8217;s root directory. Using relative paths makes your scripts more portable if you move files between folders later.<\/li>\n\n\n\n<li><strong>Testing:<\/strong> It is a best practice to run your script manually via the browser or terminal first to ensure there are no syntax errors before scheduling it as a CRON job.<\/li>\n\n\n\n<li><strong>Custom Intervals:<\/strong> If your plan allows for custom crontab formatting, you can define precise execution times (e.g., <code>0 4 * * *<\/code> to run every day at 4:00 AM).<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Summary\"><\/span>Summary<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">CRON jobs are the engine behind a self-sustaining website. By correctly defining the program, the working directory, and the execution interval in the <strong>mybox panel<\/strong>, you can ensure your background processes run reliably and efficiently.<\/p>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"template":"","format":"standard","manualknowledgebasecat":[13,25],"manual_kb_tag":[4177,4178,4179,4180,4181,4182,1895,2118,3895,4176],"class_list":["post-91","manual_kb","type-manual_kb","status-publish","format-standard","hentry","manualknowledgebasecat-cron","manualknowledgebasecat-hosting","manual_kb_tag-add-new-job","manual_kb_tag-tasks-option","manual_kb_tag-add-button","manual_kb_tag-task-form","manual_kb_tag-profile-characteristics","manual_kb_tag-usage-limit","manual_kb_tag-additional-services","manual_kb_tag-profile-settings","manual_kb_tag-maximum-execution-time","manual_kb_tag-add-new-task"],"_links":{"self":[{"href":"https:\/\/mybox.com\/help\/en\/wp-json\/wp\/v2\/manual_kb\/91","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mybox.com\/help\/en\/wp-json\/wp\/v2\/manual_kb"}],"about":[{"href":"https:\/\/mybox.com\/help\/en\/wp-json\/wp\/v2\/types\/manual_kb"}],"author":[{"embeddable":true,"href":"https:\/\/mybox.com\/help\/en\/wp-json\/wp\/v2\/users\/1"}],"version-history":[{"count":3,"href":"https:\/\/mybox.com\/help\/en\/wp-json\/wp\/v2\/manual_kb\/91\/revisions"}],"predecessor-version":[{"id":3571,"href":"https:\/\/mybox.com\/help\/en\/wp-json\/wp\/v2\/manual_kb\/91\/revisions\/3571"}],"wp:attachment":[{"href":"https:\/\/mybox.com\/help\/en\/wp-json\/wp\/v2\/media?parent=91"}],"wp:term":[{"taxonomy":"manualknowledgebasecat","embeddable":true,"href":"https:\/\/mybox.com\/help\/en\/wp-json\/wp\/v2\/manualknowledgebasecat?post=91"},{"taxonomy":"manual_kb_tag","embeddable":true,"href":"https:\/\/mybox.com\/help\/en\/wp-json\/wp\/v2\/manual_kb_tag?post=91"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}