Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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