Cleanup Sitecore Mediacache and logfiles

Sitecore-Alert: Harddisk full. Why? Oh… that’s a lot of Gigabytes in the media-cache!

And the reason is that the cache is set to 90 days. But with High Quality- images, different view-sizes and some synchronize-job it grows very quick. That’s a job for our CleanupAgent in the web.config.

<!-- Agent to clean up work files -->
<agent type="Sitecore.Tasks.CleanupAgent" method="Run" interval="06:00:00">
   <files hint="raw:AddCommand">
[...]
      <remove folder="/App_Data/MediaCache" pattern="*.*" maxAge="90.00:00:00" recursive="true" />
   </files>
</agent>

I assume the interval is just hours- minutes-seconds, but I haven’t found anything yet that confirms this. So once every 6 hours the agent starts it’s job.

The files in ‘/App_Data/MediaCache’can have a max-age of 90 days. Let’s reduce that to 7 days.

It’s also the place to cleanup the logfiles:

<remove folder="$(dataFolder)/logs" pattern="log.*.txt" maxCount="20" minAge="7.00:00:00" />

Speaks for itself.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s