36 lines
548 B
Plaintext
36 lines
548 B
Plaintext
|
#!/usr/bin/zsh
|
||
|
|
||
|
# purge memory
|
||
|
free -h
|
||
|
|
||
|
echo "clearing memory"
|
||
|
sudo sync
|
||
|
sudo sh -c 'echo 3 > /proc/sys/vm/drop_caches'
|
||
|
free -h
|
||
|
|
||
|
|
||
|
# clear logs
|
||
|
echo "clearing /var/log"
|
||
|
sudo du -hs /var/log
|
||
|
sudo find /var/log -type f -delete
|
||
|
sudo du -hs /var/log
|
||
|
|
||
|
#
|
||
|
rm -rf /var/lib/systemd/coredump/*
|
||
|
|
||
|
echo "clearing /etc/nginx/logs"
|
||
|
sudo du -hs /etc/nginx/logs
|
||
|
sudo find /etc/nginx/logs -type f -delete
|
||
|
sudo du -hs /etc/nginx/logs
|
||
|
|
||
|
rm ~/.xsession-errors*
|
||
|
|
||
|
|
||
|
# relete occasional junk
|
||
|
rm ~/rmlint.*
|
||
|
|
||
|
# empty trash
|
||
|
rm -rf ~/.local/share/Trash
|
||
|
|
||
|
sudo rm -rf /.Trash-1000
|