hybris Runtime Development Tools: hybris CronJob management
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,
- 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.
Shows all configured cronjobs:
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
© Rauf Aliev, August 2016