Zum Inhalt springen

Update.sh: Unterschied zwischen den Versionen

Aus Foxwiki
Die 5 zuletzt angesehenen Seiten:  TestTool/PHP-Funktionen » MediaWiki:Extension:Lockdown » pgrep » diff » Update.sh
Keine Bearbeitungszusammenfassung
K Textersetzung - „line>“ durch „line copy>“
 
(5 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt)
Zeile 1: Zeile 1:
<syntaxhighlight lang="bash" highlight="1" line>
<syntaxhighlight lang="bash" highlight="" line copy>
sudo cat auto-update.sh
#!/bin/sh
#!/bin/sh
# Variable Declaration
# Variable Declaration
host=$(cat /etc/hostname)
host=$(cat /etc/hostname)
logFile=update.log
logFile=update.log
echo "Unattached Advanced Package Tool version 0.1"
echo "Unattached Advanced Package Tool version 0.1"
echo "Created by JaganGanesh."
echo "Created by JaganGanesh."
echo "System: $host\n"
echo "System: $host\n"
echo "Re-syncing Package Index Files.."
echo "Re-syncing Package Index Files.."
echo "\n$(date)\n" >> $logFile
echo "\n$(date)\n" >> $logFile
apt update >> $logFile
apt update >> $logFile
echo "Upgrading Packages.."
echo "Upgrading Packages.."
apt -y upgrade >> $logFile
apt -y upgrade >> $logFile
echo "Upgrading Operating System.."
echo "Upgrading Operating System.."
apt -y dist-upgrade >> $logFile
apt -y dist-upgrade >> $logFile
echo "Removing Unwanted Packages.."
echo "Removing Unwanted Packages.."
apt -y autoremove >> $logFile
apt -y autoremove >> $logFile
echo "Cleaning Retrieved Package Files.."
echo "Cleaning Retrieved Package Files.."
apt -y autoclean >> $logFile
apt -y autoclean >> $logFile
echo "Cleaning Local Repository.."
echo "Cleaning Local Repository.."
apt clean >> $logFile
apt clean >> $logFile
echo "\nAll Done, Have a Great Day!\n"
</syntaxhighlight>


echo "\nAll Done, Have a Great Day!\n"root@speicherboy ~ #
[[Kategorie:Bash/Scripting]]
</syntaxhighlight>
[[Kategorie:Linux/Software]]

Aktuelle Version vom 11. Mai 2025, 13:45 Uhr

#!/bin/sh
# Variable Declaration
host=$(cat /etc/hostname)
logFile=update.log
echo "Unattached Advanced Package Tool version 0.1"
echo "Created by JaganGanesh."
echo "System: $host\n"
echo "Re-syncing Package Index Files.."
echo "\n$(date)\n" >> $logFile
apt update >> $logFile
echo "Upgrading Packages.."
apt -y upgrade >> $logFile
echo "Upgrading Operating System.."
apt -y dist-upgrade >> $logFile
echo "Removing Unwanted Packages.."
apt -y autoremove >> $logFile
echo "Cleaning Retrieved Package Files.."
apt -y autoclean >> $logFile
echo "Cleaning Local Repository.."
apt clean >> $logFile
echo "\nAll Done, Have a Great Day!\n"