Page 1 of 1

Automatisierte Updates per Cronjob

Posted: Tue 16. May 2017, 06:54
by h3rb3rn
Aktualisierte Fassung vom 18.05.2021

Skript erstellen

Code: Select all

cd ~
echo "/usr/bin/apt update;
/usr/bin/dpkg --configure -a;
/usr/bin/apt --yes --allow-unauthenticated -f install;
/usr/bin/apt --yes --allow-unauthenticated dist-upgrade;
/usr/bin/apt --yes --allow-unauthenticated -f install;
/usr/bin/apt-get --yes --allow-unauthenticated autoremove;
/usr/bin/apt autoremove;
" > update.sh
Starter anlegen (unter xfce4)
rechte Maustaste auf dem Schreibtisch (Desktop) und im Kontextmenü den Punkt "Starter erstellen ..." anklicken
starter-anlegen.png
starter-anlegen.png (34.76 KiB) Viewed 3239 times


Optional
für Systeme die im 24/7 Betrieb laufen

Als root ein cronjob erstellen mit

Code: Select all

crontab -e
Zeile einfügen mit folgenden Inhalt

Code: Select all

0 2 * * *	/bin/bash /home/username/update.sh > /home/username/update_$(date +%Y%m%d%H%M).log
Pfad zur update.sh muss an eigenes System angepasst werden!