-
-
Save f403/21e5b73eb411703132507b9a5fa06d61 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