# Log Rotate

**URL:** <https://community.zeek.org/t/log-rotate/1429>\
**Category:** Zeek\
**Created:** [October 30, 2008, 3:49pm UTC](https://community.zeek.org/t/log-rotate/1429 "2008-10-30T15:49:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![noah\_zak](https://avatars.discourse-cdn.com/v4/letter/n/9de0a6/32.png) [@noah\_zak](https://community.zeek.org/u/noah_zak)\
**Post date:** [October 30, 2008, 3:49pm UTC](https://community.zeek.org/t/log-rotate/1429/1 "2008-10-30T15:49:00Z")

</div>

When running the rotate-logs script I want the logs to be moved into a separate directory that the newly created logs. For example when the logs rotate on the hour I want conn.old to be moved to /usr/local/old and conn.new to stay in /usr/local/bro/logs. Does anyone know how to do this?

Thanks

---

<div class="post-metadata">

**Author:** ![robin](https://yyz1.discourse-cdn.com/flex011/user_avatar/community.zeek.org/robin/32/599_2.png) [@robin](https://community.zeek.org/u/robin)\
**Post date:** [November 3, 2008, 7:00pm UTC](https://community.zeek.org/t/log-rotate/1429/2 "2008-11-03T19:00:33Z")

</div>

You can define a postprocessor to be run after rotation which can  
move the files somewhere else. There's actually a script in the  
distribution to do just that, see aux/scripts/mvfile (the beginning  
of the script explains how to set this up).

Robin

---

<div class="post-metadata">

**Author:** ![noah\_zak](https://avatars.discourse-cdn.com/v4/letter/n/9de0a6/32.png) [@noah\_zak](https://community.zeek.org/u/noah_zak)\
**Post date:** [November 4, 2008, 11:48pm UTC](https://community.zeek.org/t/log-rotate/1429/3 "2008-11-04T23:48:36Z")

</div>

Thank you, that is how I was able to accomplish the task.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/zeek/original/1X/f09d732bc2cc7c7cc7e35db67cf4e1d5233ce7a7.png) [@system](https://community.zeek.org/u/system)\
**Post date:** [May 6, 2022, 3:38pm UTC](https://community.zeek.org/t/log-rotate/1429/4 "2022-05-06T15:38:44Z")

</div>


