Skip to content

Instantly share code, notes, and snippets.

@decklin
Created December 29, 2010 17:42
Show Gist options
  • Save decklin/758794 to your computer and use it in GitHub Desktop.
Save decklin/758794 to your computer and use it in GitHub Desktop.
#!/bin/bash
log="$1"
keep="${2:-2}"
if command -v savelog >/dev/null 2>&1; then
savelog -l -c "$keep" "$log"
else
echo "Error: savelog not found. Please check that OS is supported."
echo "Ignoring log_keep, rotating 2 files. Total log size unknown."
mv -f "$1" "$1.0"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment