Commit 1ae560ff authored by Martin Mai's avatar Martin Mai
Browse files

-

parent 2e299035
kommandos-ubuntu-patches
========================
## tasks checkliste patches manuell einspielen und server restarten
### patches einspielen
```
ssh root@141.13.<salt-master-ip>
byobu
touch /root/uniba.de/info/block-system-restart/saltstack
# https://docs.saltstack.com/en/latest/ref/modules/all/
#target="*.*1792.**"
target=".*"
#salt -E "$target" pkg.list_upgrades
salt -E "$target" pkg.upgrade dist-upgrade
```
#### restart
```
salt -E "$target" cmd.run /usr/lib/update-notifier/update-motd-reboot-required
salt -E "$target" cmd.run '/usr/lib/update-notifier/update-motd-reboot-required
| egrep "System restart required|Neustart des Systems erforderlich" && ! find /root/uniba.de/info/block-system-restart/* && init 6'
sh /root/uniba.de/tools/vorlagen/cmds/checks/patches/patches.sh
date
```
## Wartung
### / Info
```
salt "$target" cmd.run uptime
salt "$target" cmd.run 'find /root/uniba.de/info/block-system-restart/* '
salt "$target" pkg.list_repos
salt "$target" pkg.refresh_db
salt "$target" pkg.info_installed update-notifier-common
target=".*1792.*"
salt -E "$target" disk.usage
salt -E "$target" disk.percent /var
salt -E "$target" status.meminfo
salt -E "$target" stauts.diskusage
target=".*"
salt -E "$target" status.loadavg
salt -E "$target" status.meminfo
```
# Platz freigeben
```
#belegung anschauen
du -h --total --max-depth=1 /var 2>temp.2
du --exclude=/var/moodledata-moodle-upgrade --max-depth=1 /var/lib/ | sort -n
du --max-depth 2 --one-file-system /var/log/ | sort -n -r
#Unbenutzte Linux Kernel Headers und Module entfernen
# http://ubuntugenius.wordpress.com/2011/01/08/ubuntu-cleanup-how-to-remove-all-unused-linux-kernel-headers-images-and-modules/
dpkg -l 'linux-*' | sed '/^ii/!d;/'"$(uname -r | sed "s/\(.*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d' | xargs sudo apt-get -y purge
```
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment