Skip to content

Instantly share code, notes, and snippets.

@vulpicastor
Created December 30, 2015 00:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vulpicastor/08b38801371e98bde099 to your computer and use it in GitHub Desktop.
Save vulpicastor/08b38801371e98bde099 to your computer and use it in GitHub Desktop.
A simple script to rotate your zlog.
#!/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