cancel
Showing results for 
Search instead for 
Did you mean: 

How to Call Export scripts in Cronjob?

Former Member
0 Kudos

Hi Team,

I have requirement where I want to export the bunch of data from the selected types. I have written the scripts (separate script for each type) and now I want to write a cronjob which should execute these export scripts one-by-one.

Let me know the best practice and solution for this.

Accepted Solutions (0)

Answers (3)

Answers (3)

0 Kudos

Hi ,

You can try using export API (ImpExExportCronjob).

https://help.hybris.com/1808/hcd/8361ab18bb434ba3abbac01e3c1c46c8.html

Please check this OOTB class de.hybris.platform.impex.jalo.ImpExExportTest for your reference.

Thanks,

Former Member
0 Kudos

Hi, Just wondering if you got any solution for this?

0 Kudos

You can either have one export script with all your types in one cronjob, or you can have multiple export scripts and multiple cronjobs, as the export can only have one configured export script.

If you combine all your export scripts into one, that should be fine (as long as they are all different item types), since the export will generate one CSV file for each type.

First you create the ImpExMedia to contain your export script:

 INSERT_UPDATE ImpExMedia;code[unique=true];mime;realfilename;@media[translator=de.hybris.platform.impex.jalo.media.MediaDataTranslator][forceWrite=true]
 ;OrderExportImpex;application/octet-stream;order-data-export.impex;$jarResource/order-data-export.impex

Then you assign the ImpExMedia to your ExportCronjob

 INSERT_UPDATE ImpExExportCronJob;code[unique=true];job(code);jobMedia(code);singleFile;sessionLanguage(isoCode)[default=en]
 ;OrderExportCronJob;ImpEx-Export;OrderExportImpex;true
Former Member
0 Kudos

Thanks for your response. My requirement is not an one time activity by running the impex . I need to write a cronjob which needs to run on weekly basis and in that cronjob I need to call all those export scripts(which will also run on weekly basis)