Introduction
A
Cron job is a term for a command that is run on a regular schedule, by the event from the system or manually. There are different types of the preconfigured cronjobs in hybris, namely
- SOLR and Lucene related: indexing, updating, removing data,
- Clean up unnecessary data from the database or file system,
- Product Catalog synchronization,
- Regular data export,
- Workflow,
- Impex import.
In hybris, cronjobs don’t have any other inputs besides the cronjob configuration and the current state of the system. Being executed, the cronjobs perform some checks and do some actions depending on cronjob purpose: updating or removing the information in the database or file system.
For the developer, it is a common task to manually trigger the cronjobs during the development process. Hybris has web tools for cronjob management, backoffice and HMC. These ways are good for single use, but if you need to do it repeatedly, it is much easier to use the console utility.
Indexing is a cronjob task, so if you change the logic of the indexer (that is more or less common task for large projects), you will need to execute it many times while the development or testing phase is not over. For this particular task, the console tool is particularly useful.
Usage
Shows all configured cronjobs:
./hybrisCronjob.sh -a
Changes the status of the particular cronjob:
./hybrisCronjob.sh -c <cronjobName> -s <true/false>
Execute the cronjob:
./hybrisCronjob.sh -e <cronjobName>
./hybrisCronJob.sh -e full-electronicsIndex-cronJob
Video
© Rauf Aliev, August 2016
Boufnichel Mohamed
1 September 2016 at 13:40
Great work !
Sorry, i thought is was introduced with the hybris 6.0 !
have you put it somewhere in github or it’s private ?
Thanks
David Boyd
2 March 2017 at 09:57
This looks very useful – is there a location of where I can get a hold of this tool?
Rauf Aliev
2 March 2017 at 13:26
Please send a request to me, rauf_aliev@epam.com