Skip to content

Instantly share code, notes, and snippets.

@lincolnthomas
Created January 25, 2017 20:18
Show Gist options
  • Save lincolnthomas/95264f8095b08f4a0e99f987d0745603 to your computer and use it in GitHub Desktop.
Save lincolnthomas/95264f8095b08f4a0e99f987d0745603 to your computer and use it in GitHub Desktop.
Force rotate of /var/log/eucalyptus/cloud-debug.log* files. The eucalyptus-cloud service must NOT be running. Gives you a fresh cloud-debug.log file when you restart the service, for easier debugging.
#!/bin/bash
VLED=/var/log/eucalyptus/cloud-debug.log
rm -f $VLED.10
for ((i=9; i>0; i--)) ; do
j=$((i+1))
mv $VLED.$i $VLED.$j
done
mv $VLED $VLED.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment