diff options
Diffstat (limited to 'update.sh')
| -rwxr-xr-x | update.sh | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/update.sh b/update.sh new file mode 100755 index 000000000..64b2e881d --- /dev/null +++ b/update.sh @@ -0,0 +1,40 @@ +#!/bin/bash + +set -e + +sudo -v + +sudo pacman -Syu --noconfirm + +yay -Syu --noconfirm + +sudo paccache -r + +yay -Scc --noconfirm || true +rm -rf ~/.cache/yay/* + +#rm -rf ~/Downloads/* + +rm -rf ~/.cache/* + +sudo fd . /tmp --max-depth 1 \ + --type f --type d \ + --exclude 'systemd-private-*' \ + --changed-before 7d \ + -0 | while IFS= read -r -d '' item; do + rm -rf -- "$item" +done + +sudo fd . /var/tmp --max-depth 1 \ + --type f --type d \ + --exclude 'systemd-private-*' \ + --changed-before 7d \ + -0 | while IFS= read -r -d '' item; do + rm -rf -- "$item" +done + +sudo rm -rf ~/.local/share/Trash/* + +sudo pacman -Qdtq | sudo pacman -Rns - || true + +sudo journalctl --vacuum-time=3d |
