Created
August 16, 2012 08:27
-
-
Save tristan/3368391 to your computer and use it in GitHub Desktop.
Log rotate/cleanup script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
BASE_DIR=/tmp | |
mv $BASE_DIR/couchdb.log $BASE_DIR/couchdb-`date +%Y-%m-%d -d 'yesterday'`.log | |
touch $BASE_DIR/couchdb.log | |
LAST_WEEK=$BASE_DIR/couchdb-`date +%Y-%m-%d -d '8 days ago'`.log | |
if [ -a $LAST_WEEK ] | |
then | |
rm $LAST_WEEK | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment