monak1983 Posted September 29 Share Posted September 29 Hi to all, I'm ready with my PS 8.1.7 site to go online. I have catalog rules: I should add on my server s cron job to make my shop fully functioning? If yes what is the command to add? Regards Marco Link to comment Share on other sites More sharing options...
NordicDesigner Posted September 30 Share Posted September 30 Hi, congrats on getting your PrestaShop 8.1.7 site ready to go online! To ensure your catalog price rules (e.g., discounts or promotions) apply automatically, you'll need to set up a cron job on your server. The cron job will automate tasks like applying those rules, so they’re reflected on your site without manual intervention. PrestaShop has a built-in "Cron tasks" module. If you haven’t already, install it via your PrestaShop back office: Go to Modules > Module Catalog. Search for Cron tasks manager and install it. Once installed, you'll find a cron job URL in the module configuration. This URL is used to run the PrestaShop tasks regularly. Access your server via SSH and use the following command to edit the crontab: crontab -e Then, add a line for your cron job, which typically looks like this: */30 * * * * wget -qO- 'http://yourdomain.com/modules/cronjobs/cron.php?secure_key=YOUR_SECURE_KEY' This cron job will execute every 30 minutes. Adjust the timing if needed. Make sure your cron job runs correctly by checking the cron logs on your server or manually running the command in your browser to see if the tasks execute. Link to comment Share on other sites More sharing options...
monak1983 Posted October 1 Author Share Posted October 1 Hi NordicDesigner, thanks a lot for your reply. I have installed Cron Task Manger but seems to bo compatible only with PS 1.6. I have installed and when I try to save configuration I have this error message: "An error occurred while trying to contact PrestaShop's cron tasks webservice." So I copy link and add to my server cron configuration. Is enough? Module is needed only to have correct link to put on my server cron job? Regards Marco Link to comment Share on other sites More sharing options...
NordicDesigner Posted October 2 Share Posted October 2 If you're getting that error with the Cron Tasks Manager and you’ve already copied the cron URL from the module, the module itself is not essential for the cron job to work. Its main purpose is to give you the correct link to use on your server. Here’s what you should do: If you have the cron URL (the one you copied from the module), you can proceed by adding it to your server's cron job configuration, as you've done. So in your case, adding the cron job manually on your server like this: */30 * * * * wget -qO- 'http://yourdomain.com/modules/cronjobs/cron.php?secure_key=YOUR_SECURE_KEY' should be enough for PrestaShop to run the necessary tasks. Just make sure you replace YOUR_SECURE_KEY with the actual key from your setup. Once you’ve added the cron job to your server, verify that it's running by checking your server logs or manually visiting the cron URL in your browser (you should see a success message or nothing at all). No need for the module to stay active: The module is mainly useful for generating the URL, so you don’t need it after configuring the cron job directly on your server. 1 Link to comment Share on other sites More sharing options...
slonodesa Posted December 8 Share Posted December 8 (edited) Good afternoon, I'm asking for help, I can't set up a cron task for a module. If it's not difficult to help me. The module gives this entry for the file configuration: * * * * * /opt/php7.1_own/7.1.33/bin/php /home/virtwww/w_na-bb86_e519a1fb/http/modules/ets_reviews/cronjob.php secure=K1tAS63hnx I go to the server, enter the command crontab -e, then I’ll make this entry, but after saving I get an error I can’t understand what’s wrong with this entry, there’s a space in it, but I understand there shouldn’t be a space. prestashop 1.7 sorry for my english Edited December 8 by slonodesa (see edit history) Link to comment Share on other sites More sharing options...
NordicDesigner Posted December 14 Share Posted December 14 On 12/8/2024 at 7:44 PM, slonodesa said: Good afternoon, I'm asking for help, I can't set up a cron task for a module. If it's not difficult to help me. The module gives this entry for the file configuration: * * * * * /opt/php7.1_own/7.1.33/bin/php /home/virtwww/w_na-bb86_e519a1fb/http/modules/ets_reviews/cronjob.php secure=K1tAS63hnx I go to the server, enter the command crontab -e, then I’ll make this entry, but after saving I get an error I can’t understand what’s wrong with this entry, there’s a space in it, but I understand there shouldn’t be a space. prestashop 1.7 sorry for my english Hey! Check if /opt/php7.1_own/7.1.33/bin/php is the correct PHP path (use which php to confirm). Your cron entry likely fails due to secure=K1tAS63hnx; wrap the command in quotes: * * * * * "/opt/php7.1_own/7.1.33/bin/php /home/virtwww/w_na-bb86_e519a1fb/http/modules/ets_reviews/cronjob.php secure=K1tAS63hnx" Ensure cronjob.php has the right permissions (chmod 755 cronjob.php). To debug, redirect output to a log file: * * * * * /opt/php7.1_own/7.1.33/bin/php /home/virtwww/w_na-bb86_e519a1fb/http/modules/ets_reviews/cronjob.php secure=K1tAS63hnx >> /home/virtwww/w_na-bb86_e519a1fb/cron.log 2>&1 Let me know the error message if it still doesn’t work 😇 Link to comment Share on other sites More sharing options...
slonodesa Posted December 14 Share Posted December 14 Good afternoon. Thank you very much for your answer. I figured it out, checked, the script is running. The reason was that the entire entry that the module provides must be entered in one line, both the time and the command and the security key. And there is one space between these records. And the module gives two lines, and when I add it to crontab I get 3 lines. All the paths are correct, everything seems to be ok, everything works. 1 Link to comment Share on other sites More sharing options...
slonodesa Posted December 14 Share Posted December 14 All I found on the Internet about setting up crontab was a trivial time setting, only on the second day of searching I found that it requires each command on one line. 1 Link to comment Share on other sites More sharing options...
NordicDesigner Posted December 14 Share Posted December 14 1 minute ago, slonodesa said: Good afternoon. Thank you very much for your answer. I figured it out, checked, the script is running. The reason was that the entire entry that the module provides must be entered in one line, both the time and the command and the security key. And there is one space between these records. And the module gives two lines, and when I add it to crontab I get 3 lines. All the paths are correct, everything seems to be ok, everything works. Great news! 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now