Optimize scripts

This commit is contained in:
The StarOpenSource Project 2024-03-15 02:17:42 +01:00
parent ac3fa686ba
commit e5cedf059c
3 changed files with 11 additions and 7 deletions

View file

@ -1,4 +1,4 @@
#!/bin/bash
rm -rf /root/.cache
rm -rf /home/{aur,firefish}/.cache
rm -rf /home/aur/.cache
echo ":: Purged all \".cache\" directories."

View file

@ -3,5 +3,5 @@ if [ ! -f "/usr/bin/ncdu" ]; then
echo ":: Error: You do not have ncdu installed."
exit 1
fi
ncdu /
ncdu --exclude-kernfs /
echo ":: Ran \"ncdu /\" successfully."

View file

@ -1,16 +1,20 @@
#!/bin/bash
echo ":: Cleaning up..."
export "diskusage_precleanup=$(df -h /;echo "==========";df -h /data)"
export "diskusage_precleanup_bytes=$(df /;echo "==========";df -h /data)"
export "diskusage_precleanup_bytes=$(df /;echo "==========";df /data)"
soscmd-prune
soscmd-cache
soscmd-bleachbit
echo ":: Cleanup successful."
echo -e "\n:: Disk usage before cleanup:"
echo -e "\n#### before cleanup ####"
echo "$diskusage_precleanup"
echo ":: after cleanup:"
echo "#### after cleanup ####"
df -h /
echo "=========="
df -h /data
echo -e "\n:: And here in measured in bytes, before cleanup:"
echo -e "\n#### before cleanup (bytes) ####"
echo "$diskusage_precleanup_bytes"
echo ":: and after:"
echo "#### after cleanup (bytes) ####"
df /
echo "=========="
df /data