Created
February 19, 2016 16:13
-
-
Save dougalb/67382a3556823a8a36cd to your computer and use it in GitHub Desktop.
ami_cleanup.sh script for CfnCluster
This file contains hidden or 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
| rm -rf /var/tmp/* /tmp/* | |
| rm -rf /var/lib/cloud/instances/* | |
| rm -f /var/lib/cloud/instance | |
| rm -rf /etc/ssh/ssh_host_* | |
| rm -f /etc/udev/rules.d/70-persistent-net.rules | |
| find /var/log -type f -exec /bin/rm -v {} \; | |
| touch /var/log/lastlog | |
| cd /root | |
| rm -f .viminfo | |
| history -c | |
| history -w | |
| cat /dev/null > ~/.bash_history | |
| sync;sync;sync | |
| history -c | |
| history -w | |
| su - ec2-user -c 'rm -f .viminfo' | |
| su - ec2-user -c 'cat /dev/null > ~/.bash_history' | |
| sync;sync;sync |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment