cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Safe option to remove media

Former Member
0 Likes
3,084

Hi,

The following directory have grown in size above 3gb:

/srv/hybris/data/media/sys_master/impex

Is it safe to remove all medias from this folder using: HMC->Multimedia->Media, then specify folder = "impex" and filter by date? or we can remove the cronjob executions.

Kindly suggest some safer way to perform media cleanup activity.

Thanks,

Accepted Solutions (0)

Answers (1)

Answers (1)

andyfletcher
Active Contributor
0 Likes

You're probably better deleting the impex cronjob that was used to import that media. Deleting them will delete the impex media plus any supporting media, e.g. logs, dump files etc.

Take a look at the CleanupCronJobStrategy

https://help.hybris.com/6.7.0/hcd/8b9ce4868669101499b2f0f25ef9395f.html#cronjob-technicalguide-clean...

The default settings will delete all impex cronjobs (and their supporting media) as long as they were successfully imported and are older than 14 days. It will delete other cronjobs too that have no trigger and are older than the 14 days so you might want to review the exclusion list.

You could create a cronjob with this impex

 INSERT_UPDATE CronJob;code[unique=true];job(code);sessionUser(uid);sessionLanguage(isocode)
 ;cleanupCronJobs;cleanupCronJobsPerformable;admin;en

and optionally schedule it run every day at 1am with

 INSERT_UPDATE Trigger;cronjob(code)[unique=true];cronExpression
 ;cleanupCronJobs;0 0 1 ? * *
Former Member
0 Likes

: I created a job based on CleanupCronJobStrategy and after executing I still have Impex Media items related to the cronjobs in my database, though the cronjobs got deleted. Is this job responsible for deleting cronjob media too? Or Is there any other job available for performing that action?

andyfletcher
Active Contributor
0 Likes

Not sure why yours wouldn't be deleted. It works for me.

Log files have a partof="true" attribute on the definition of CronJob.logFiles and sync dump medias have a similar attribute in the relationship SyncJobScheduleMediaRelation For impex the unresolvedDataStore and workMedia attributes are marked as partof.

Are you talking about some other linked media?