cancel
Showing results for 
Search instead for 
Did you mean: 

How to create cronjob to says from stage to online catalog ?

former_member634278
Participant
0 Kudos

Hello,

How to create cronjob to says from stage to online catalog ?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Saleh!

I'm assuming you mean to say 'to sync from Stage to Online'. For this you may create another dependent catalog version to your Staged catalog version, i.e.:

hMC > Catalog > Catalogs > Open your catalog and the 'Staged' catalog version > Catalog Versions tab > Right-click on the table of Dependent Catalog Versions

Then, after you create this sync job, you can simply create a cronjob and select this newly created sync job as its job.

hMC > System > Right-click CronJobs > Create 'CronJob' > Select the job in the list

Best regards,

Niko

Answers (3)

Answers (3)

former_member634278
Participant
0 Kudos

No .. the job is not running and i create new cron job that using the same type of dependent sync!

former_member634278
Participant
0 Kudos

Hello,

When i create the cron job from that type , the start cronjob now button disabled !

Former Member
0 Kudos

Is the job still running? The impex below would launch it as well.

Former Member
0 Kudos

You can also do this via impex...

 $productCatalog1=MyProductCatalog
 $sourceProductCV=sourceVersion(catalog(id[default=$productCatalog1]),version[default='Staged'])[unique=true,default='$productCatalog1:Staged']
 $targetProductCV=targetVersion(catalog(id[default=$productCatalog1]),version[default='Online'])[unique=true,default='$productCatalog1:Online']
 
 INSERT_UPDATE CatalogVersionSyncJob;code[unique=true];$sourceProductCV;$targetProductCV;
 "#%afterEach: {
    
 import de.hybris.platform.catalog.jalo.SyncItemCronJob;
 import de.hybris.platform.catalog.jalo.SyncItemJob;
    
 SyncItemJob catalogSyncJob =impex.getLastImportedItem();
 SyncItemCronJob syncJob = catalogSyncJob.newExecution();
 syncJob.setLogToDatabase(false);
 syncJob.setLogToFile(true);
 syncJob.setForceUpdate(false);
 catalogSyncJob.configureFullVersionSync(syncJob);
 catalogSyncJob.perform(syncJob, true);
 }"
 ;sync MyProductCatalog:Staged->Online;;;;