Skip to content

Instantly share code, notes, and snippets.

@ksauzz
Created October 7, 2011 05:37
Show Gist options
  • Select an option

  • Save ksauzz/1269546 to your computer and use it in GitHub Desktop.

Select an option

Save ksauzz/1269546 to your computer and use it in GitHub Desktop.
compless log
#!/bin/bash
PLAIN_TIME=10
LOG_DIR=/var/log/hoge
find $LOG_DIR -maxdepth 1 -name \*.log.\* -type f -mtime +$PLAIN_TIME | sort | egrep -v "gz$"|xargs gzip
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment