Last active
February 14, 2025 20:19
-
-
Save ccharlton/e84c82f60a568163a4b5cb30f6cd514e to your computer and use it in GitHub Desktop.
Maintenance shell script for local workstation updates
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/zsh | |
# Workstation maintenance script | |
# This script is a simple shell script that updates the shell and various libraries. | |
# It’s a good idea to run this script every week or so to keep a workstation up to date. | |
# The script can be saved in the `~/bin` directory as executable. | |
# $ chmod +x ~/bin/maintenance.sh | |
# To run the script, use the following command: | |
# $ ~/bin/maintenance.sh | |
# Crontab example to run the script every Friday 7am | |
# 0 7 * * 5 ~/bin/maintenance.sh | |
# Start | |
echo "Maintenance script starting" | |
# Shell | |
echo "\n\n" | |
echo "1️⃣ Updating shell..." | |
# $ZSH needs to be defined within the automated script you created | |
time zsh -ic "$ZSH/tools/upgrade.sh" | |
# Libraries | |
echo "\n\n" | |
echo "2️⃣ Updating Homebrew and recipes..." | |
time brew update --quiet && brew upgrade --quiet && brew cleanup --quiet | |
# Google Cloud Platform | |
echo "\n\n" | |
echo "3️⃣ Updating GCP components..." | |
time gcloud components update --quiet | |
# Docker Desktop | |
echo "\n\n" | |
echo "4️⃣ Updating Docker Desktop..." | |
time docker desktop update | |
# Lando | |
echo "\n\n" | |
echo "5️⃣ Updating Lando..." | |
time lando update --yes | |
# Done | |
echo "\n\n" | |
echo "✅ Maintenance complete" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment