Files
runner-images/images/linux/scripts/installers/cleanup.sh
Mikhail Timofeev 0e7d6a75c6 [Ubuntu] Add /tmp cleanup (#878)
* add tmp cleanup

* low min to 17800
2020-05-14 09:08:27 +03:00

17 lines
437 B
Bash

#!/bin/bash
# before cleanup
before=$(df / -Pm | awk 'NR==2{print $4}')
# clears out the local repository of retrieved package files
# It removes everything but the lock file from /var/cache/apt/archives/ and /var/cache/apt/archives/partial
apt-get clean
rm -rf /tmp/*
# after cleanup
after=$(df / -Pm | awk 'NR==2{print $4}')
# display size
echo "Before: $before MB"
echo "After : $after MB"
echo "Delta : $(($after-$before)) MB"