Skip to content

Commit

Permalink
also remove build script directory
Browse files Browse the repository at this point in the history
  • Loading branch information
padthaitofuhot authored Sep 5, 2018
1 parent 3cfde22 commit 31021ed
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions tools/zerofill.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# curl -sS http://cache.local/ova/zerofill.sh | bash
process() {

### ephemera reduction
echo "Reducing ephemera"
sudo package-cleanup -y --oldkernels --count=1
sudo yum -y clean all
Expand All @@ -10,9 +11,6 @@ sudo find /home -type f -name 'registry.crt' -exec rm -f {} \;
echo "Truncating /var/logs"
sudo find /var/log -type f -exec truncate --size 0 {} \;

echo "Defragmenting /"
sudo xfs_fsr -vvvv /

echo "Removing other logs"
rm $HOME/ECS-CommunityEdition/install.log

Expand All @@ -22,12 +20,19 @@ sudo find /root -name '.bash_history' -exec rm -f {} \;
sudo history -c
history -c

rm -rf $HOME/admin/bin

### filesys reduction
echo "Defragmenting /"
sudo xfs_fsr -vvvv /

echo "Zero-filling /"
sudo dd if=/dev/zero of=/tmp/zerofill.tmp bs=10M & pid=$!
sleep 5
while sudo kill -USR1 $pid; do sleep 1; done
sudo rm -f /tmp/zerofill.tmp

### shutdown
echo "Powering off"
sudo shutdown -h now

Expand Down

0 comments on commit 31021ed

Please sign in to comment.