Created
February 25, 2011 17:16
-
-
Save dpritchett/844115 to your computer and use it in GitHub Desktop.
pull today's logs out of a monthly rotating logfile
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 | |
DATE=`date +%Y%m%d` | |
if [ "$1" == "" ]; then | |
WORKDIR=~/Board | |
SERVER=prod | |
echo 'Pulling PRODUCTION log' | |
else | |
WORKDIR=~/BoardDev | |
SERVER=dev | |
echo 'Pulling DEVELOPMENT log' | |
fi | |
WORKDIR=$WORKDIR/Dataset/Log | |
cd $WORKDIR | |
grep $DATE `dir -1ut | head -1` > /tmp/boardlog.log | |
LOGFILE=~/${DATE}_${SERVER}.log | |
mv /tmp/boardlog.log $LOGFILE | |
LOGFILE=`cygpath -w ${LOGFILE}` | |
echo 'Writing to' $LOGFILE | |
notepad++ $LOGFILE & |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment