Created
December 30, 2015 00:25
-
-
Save vulpicastor/08b38801371e98bde099 to your computer and use it in GitHub Desktop.
A simple script to rotate your zlog.
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/sh | |
ZCLASS=$1 | |
DATE=`date +%F` | |
PRESS='xz' | |
if [ -n "$ZCLASS" ] | |
then | |
mv -i "$ZCLASS" "$ZCLASS.$DATE" && $PRESS "$ZCLASS.$DATE" || ( echo Failed; exit 1 ) | |
else | |
echo "You must specify a class to rotate." | |
exit 1 | |
fi | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment