summaryrefslogtreecommitdiff
path: root/update.sh
blob: 64b2e881de77333e9a706f3720802c8b916c829e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
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