Skip to content

Instantly share code, notes, and snippets.

@ccharlton
Created November 6, 2024 21:39
Show Gist options
  • Save ccharlton/e84c82f60a568163a4b5cb30f6cd514e to your computer and use it in GitHub Desktop.
Save ccharlton/e84c82f60a568163a4b5cb30f6cd514e to your computer and use it in GitHub Desktop.
Maintenance shell script for local workstation updates
#!/bin/zsh
# Charlton's 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
# Start
echo "Maintenance script starting"
echo "\n\n"
echo "1️⃣ Updating shell..."
# Shell
time zsh -ic "omz update"
echo "\n\n"
echo "2️⃣ Updating Homebrew and recipes..."
# Libraries
time brew update && brew upgrade && brew cleanup
echo "\n\n"
echo "3️⃣ Updating GCP components..."
# Google Cloud Platform
time gcloud components update
# 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