/
system_maintenance
executable file
·79 lines (53 loc) · 2.08 KB
/
system_maintenance
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#!/usr/bin/fish
# todo:
# use some colors for the echo messages
# listen to sigint
# Make sure to have a strong connection to the internet for the steps that depend on the network
# The requests to the various packages can be run in parallel!
fastfetch
echo "Let's look for any failed services as reported by systemd"
systemctl --failed
echo "Here, we can see the error logs from journalctl ..."
journalctl -p 3 -xb
echo "Clearing old system logs ..."
sudo journalctl --vacuum-time=1d
echo "updating anti-virus signatures"
sudo freshclam
echo "Running anti virus scan on home folder"
clamscan ~
echo "Emptying trash ..."
# needs to be adapted to fish script ... help expand
# rm -rf ~/.local/share/Trash/files/*
echo "Clearing pacman caches ..."
paccache -r
echo "Removing orphaned packages ..."
for p in (pacman -Qtdq)
# this seems pretty risky
yes | sudo pacman -Rns $p
end
echo "Retrieving mirror status and updating based on location"
# pacman-mirrors --status
sudo pacman-mirrors --geoip --api --protocol https
echo "Updating pacman packages ..."
# describe what the flags are doing; should be easier to read
yay
echo "The following Kernels are intalled:"
mhwd-kernel --listinstalled
echo "These Kernels are available:"
mhwd-kernel --list
echo "If applicable, please consider upgrading with: 'mhwd-kernel install <kernel_name>'"
echo "Please consider using Filelight to see how the file system is used"
echo "Here is an overview of your log file folders:"
sudo du -h /var/log
echo "Outdated npm packages ..."
npm outdated -g --depth=0
# can we run this in parallel? Could be done independently of the manjaro package stuff
echo "Updating global npm packages ..."
sudo npm update -g
# the extension manager for my shell
omf update
echo "Consider inspecting what's on the hard drive by running filelight"
echo "When is the last time you have done a backup?"
echo "Maybe it is a good point in time to clear browser caches?"
echo "You should look at all the installed packages on this machine - do you need them all?"
echo "When is the last time you checked for the availability of a new kernel?"