Last active
January 25, 2018 15:25
-
-
Save xacrimon/8b722eaa1cf56c234cfd6fa7a566d5b8 to your computer and use it in GitHub Desktop.
A script to clean the system of logs and caches for arch linux, adjust the username for the homedir accordingly
This file contains 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
#!/bin/sh | |
user1=archie | |
if [[ $(whoami) != "root" ]] | |
then echo "Run as root" | |
exit 1 | |
fi | |
if [ "$(ls /bin | grep trizen)" == "trizen" ] | |
then | |
PKGMAN=trizen | |
else | |
PKGMAN=pacman | |
fi | |
echo "Cleaning..." | |
${PKGMAN} -Scc | |
rm -r /root/.cache | |
rm -r /home/archie/.cache | |
rm -r /var/log/journal/* | |
echo "Done!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment