In accordance with the European law, we inform you that this shop uses cookies to secure the ordering process, observe the customer traffic to improve our website/offer. For more information, You can consult our privacy policy in our TOS.
We consider that this message sometimes given by scripts and applications for the implementation of cron tasks: 'contact your server administrator' is worthy of the 80s :). In fact, whether it's the cPanel administration panel or another, this kind of elementary function has been made accessible to the end users, this is now a 'just do it' task, just read the basic cPanel instructions and this article if necessary...From your cPanel, section Advanced / Cron jobs : Attention :Cron executing at too close intervals without need/justification leads to bugs, and overflow of resources leading to the malfunction of your websiteAccording to your needs and recommendations of the editor, here are the 2 formats A and B in examples :A. PHP scripts running in internal php :/usr/bin/php -f /home/yourcpaneluser/public_html/yourfolder/your-sub-folder/yourfile.php >/dev/null 2>&1 orphp -f /home/your_user/public_html/yourfolder/your-sub-folder/yourfile.php >/dev/null 2>&1(The '-f' flag tells php to parse/execute the following file)(Check : http://php.net/manual/en/features.commandline.options.php) or, (if you get issues or forbidden access) :/usr/local/bin/php -f /home/votreusercpanel/public_html/votredossier/votre-sous-dossier/votrefichier.php >/dev/null 2>&1B. PHP scripts running externally :wget -q -O /dev/null "http://www.yourdomain.com/yourfolder/your-sub-folder/yourfile.php" >/dev/null 2>&1or/usr/bin/wget -q -O /dev/null "http://www.yourdomain.com/yourfolder/your-sub-folder/yourfile.php" >/dev/null 2>&1orcurl -s "http://www.yourdomain.com/yourfolder/your-sub-folder/yourfile.php" >/dev/null 2>&1 NB :1. Adding this in cronjob is a good thing : sleep $(expr $RANDOM \% 35);It helps server to not struggle with executing all cronjobs of servers at same second (ssh must be activated)... Integration example, it must be put at begin of cron like this :sleep $(expr $RANDOM \% 35); /usr/bin/wget -q -O /dev/null "http://www.yourdomain.com/yourfolder/your-sub-folder/yourfile.php" >/dev/null 2>&12. Avoid putting all your cron with minute value all same at 0, also space the minutes value of your cron to avoid a local conflict of your application.3. Adding >/dev/null 2>&1 permit to stop sending emails at each cron execution4. For wget cron, adding -q -O /dev/null permit to avoid wirting a file in your account at each cron execution Specific scripts, and SHELL Scripts if ordinary cron don't workA. cron with script shsh /home/yourcpaneluser/yoordomain.com/file.shB. Specificity of certain php script involving shell commands and/or shell_exec, in our virtualized environment using CageFs from Cloudlinux, it is necessary that you add this in your crontab though shell : MAILTO="user@yourmail.com"SHELL="/usr/local/cpanel/bin/jailshell"PATH="/usr/local/bin/:/usr/bin:/bin"And simply add cron in your cPanel :* * * * * php -f /home/yourcpaneluser/yoordomain.com/cron.php >/dev/null 2>&1 NB : if needed, check well and adapt your php.ini settings in your cpanel, about the default disable_functions, read doc of CMS/module and/or ask editor. Warning :the -f option may not be appropriate for some scripts, such as when optimizing wordpress by disabling wp-cron.php in wordpress... Disable wp-cron in wordpress by adding this in wp-config.php:define ('DISABLE_WP_CRON', true); and then adding the cron in cpanel (5 minutes schedule is recommended minimum, and a*update with your domain name):/usr/bin/wget -q -O /dev/null "https://www.yourwebsite.com/wp-cron.php?doing_wp_cron"
We consider that this message sometimes given by scripts and applications for the implementation of cron tasks: 'contact your server administrator' is worthy of the 80s :). In fact, whether it's the cPanel administration panel or another, this kind of elementary function has been made accessible to the end users, this is now a 'just do it' task, just read the basic cPanel instructions and this article if necessary...From your cPanel, section Advanced / Cron jobs :
Attention :Cron executing at too close intervals without need/justification leads to bugs, and overflow of resources leading to the malfunction of your websiteAccording to your needs and recommendations of the editor, here are the 2 formats A and B in examples :A. PHP scripts running in internal php :/usr/bin/php -f /home/yourcpaneluser/public_html/yourfolder/your-sub-folder/yourfile.php >/dev/null 2>&1
MAILTO="user@yourmail.com"SHELL="/usr/local/cpanel/bin/jailshell"PATH="/usr/local/bin/:/usr/bin:/bin"And simply add cron in your cPanel :* * * * * php -f /home/yourcpaneluser/yoordomain.com/cron.php >/dev/null 2>&1
Warning :the -f option may not be appropriate for some scripts, such as when optimizing wordpress by disabling wp-cron.php in wordpress...
Disable wp-cron in wordpress by adding this in wp-config.php:define ('DISABLE_WP_CRON', true);
and then adding the cron in cpanel (5 minutes schedule is recommended minimum, and a*update with your domain name):/usr/bin/wget -q -O /dev/null "https://www.yourwebsite.com/wp-cron.php?doing_wp_cron"
YOORshop SAS © 2024 All rights reserved