# Auto deletion of old log files

**URL:** https://community.wowza.com/t/auto-deletion-of-old-log-files/51417
**Category:** Wowza Streaming Engine
**Tags:** server-administration
**Created:** [June 5, 2018, 3:40pm UTC](https://community.wowza.com/t/auto-deletion-of-old-log-files/51417 "2018-06-05T15:40:34Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Arnes\_video](https://avatars.discourse-cdn.com/v4/letter/a/3da27b/32.png) [@Arnes\_video](https://community.wowza.com/u/Arnes_video)
#### Post date: [June 5, 2018, 3:40pm UTC](https://community.wowza.com/t/auto-deletion-of-old-log-files/51417/1 "2018-06-05T15:40:34Z")

</div>

Hi,

My logs are rotating daily - I used this guide [https://www.wowza.com/docs/how-to-configure-log-rolling-by-time-and-size](https://www.wowza.com/docs/how-to-configure-log-rolling-by-time-and-size) -section:To roll over by time

so my log4j.properties are copy-paste from that guide and daily log rotation is working fine.

What I need more is auto delete log files, that are older than xy days.

I google it and found a solution with log4j.appender.serverAccess.MaxBackupIndex=xy

But, unfortunately, MaxBackupIndex is not working with DailyRollingFileAppender.

Is there any other solution how to achieve this (in my opinion) very basic and common log rotate functionality?

---

<div class="post-metadata">

### Author: ![Arnes\_video](https://avatars.discourse-cdn.com/v4/letter/a/3da27b/32.png) [@Arnes\_video](https://community.wowza.com/u/Arnes_video)
#### Post date: [June 12, 2018, 4:23pm UTC](https://community.wowza.com/t/auto-deletion-of-old-log-files/51417/2 "2018-06-12T16:23:27Z")

</div>

Am I really alone with that kind of requirement? How are then you handling Wowza logs?

---

<div class="post-metadata">

### Author: ![Julio\_Goncalves](https://avatars.discourse-cdn.com/v4/letter/j/67e7ee/32.png) [@Julio\_Goncalves](https://community.wowza.com/u/Julio_Goncalves)
#### Post date: [November 14, 2018, 12:58pm UTC](https://community.wowza.com/t/auto-deletion-of-old-log-files/51417/3 "2018-11-14T12:58:11Z")

</div>

I’m too with this problem and I don’t found any solution.

---

<div class="post-metadata">

### Author: ![Pedro\_Lorenzo1](https://avatars.discourse-cdn.com/v4/letter/p/e480ec/32.png) [@Pedro\_Lorenzo1](https://community.wowza.com/u/Pedro_Lorenzo1)
#### Post date: [November 16, 2018, 10:21am UTC](https://community.wowza.com/t/auto-deletion-of-old-log-files/51417/4 "2018-11-16T10:21:19Z")

</div>

Hi!

The only solution I have found is to make a script in which I locate the log files that have the oldest days selected in a variable and remove them from the System.

With a line like this and using crontab, a Script is generated and deleted.

In this case more than 8 days old.

find -name ‘wowza\_\*.zip’ -type f -mtime +8 -exec rm -f {} ;

I hope it helps.

Pedro Lorenzo

---

<div class="post-metadata">

### Author: ![Rose\_Power-Wowza\_Com](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/rose_power-wowza_com/32/431_2.png) [@Rose\_Power-Wowza\_Com](https://community.wowza.com/u/Rose_Power-Wowza_Com)
#### Post date: [November 16, 2018, 6:25pm UTC](https://community.wowza.com/t/auto-deletion-of-old-log-files/51417/5 "2018-11-16T18:25:40Z")

</div>

Thanks for sharing that @Pedro Lorenzo.
