Skip to content

Instantly share code, notes, and snippets.

@homelinen
Last active December 30, 2015 10:29
Show Gist options
  • Save homelinen/7815999 to your computer and use it in GitHub Desktop.
Save homelinen/7815999 to your computer and use it in GitHub Desktop.
My rotation script for bouncer files
#!/bin/bash
# Clear up log files for ZNC IRC Bouncer
#
# Author: Calum Gilchrist
ZNC_HOME="/home/homelinen/.znc/"
# Remove logs older than 30 days
find $ZNC_HOME -mtime +30 -type f -name "*.log" -exec rm -v {} +
# Gzip logs older than a week
# Uses ionice and nice because ZNC runs on my Raspi
find $ZNC_HOME -mtime +7 -type f -name "*.log" -exec ionice -c 2 -n 7 nice -n 19 gzip -v {} +
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment