Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

What Are Cron Parameters?

 
  • TurabG
  • Advanced Member
  • Members
  • Join Date: 05-Apr 17
  • 71 posts

Posted 09 September 2022 - 08:16 AM #1

I can't find in the documentation. What are cron options/parameters what you can run? And that if a default Cs-Cart installation would ever need to setup cron ever at all?



 
  • ikoshkin
  • Product Manager
  • CS-Cart Architects
  • Join Date: 25-Nov 15
  • 578 posts

Posted 09 September 2022 - 10:46 AM #2

There're no articles in the CS-Cart documentation dedicated to cron specifically. We usually try to make it so that cron isn't necessary. When it is (or may be) necessary, CS-Cart interface usually shows what sort of command you can put into cron, and why.
 
One example off the top of my head is product import. If you import a CSV or XML file that is available by the same link and updates automatically every day, you may want to automate the import too. In that case, the import preset shows you a cron command like:
 

php /path/to/cart/admin.php -p --dispatch=advanced_import.import.import --preset_id=1

 
Once you add the command to cron and set the time period, the file will be imported automatically.


Ivan Koshkin,
CS-Cart Architect Team
CS-Cart Documentation | Report a bug


 
  • TurabG
  • Advanced Member
  • Members
  • Join Date: 05-Apr 17
  • 71 posts

Posted 10 September 2022 - 01:52 PM #3

Thank you. Then is there a documentation on how to create custom cron scripts?

 

For example I want to write a cron script that will disable products which haven't been updated for a while and then delete them after a while.



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 23040 posts

Posted 12 September 2022 - 07:31 AM #4

There is no specific documentation. The easiest way is to create custom controller. E.g.

 

app/addons/my_changes/controllers/frontend/my_controller.php

 

And call it with cron task

php /path/to/cart/index.php -p --dispatch=my_controller.process --cron_key=3hDcdff4fF

cron_key is not required, but we recommend you to use it. It's value should be checked in the controller


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 1210     Multi-Vendor              USD 1250    Multi-Vendor PLUS           USD 3100 (2775)
CS-Cart Ultimate  USD 4025     CS-Cart + YOUPI      USD 1459      Multi-Vendor Ultimate       USD 7500 (6000)