This directory contains scripts and backups for managing your Oh My Zsh configuration. The system provides easy backup and restore functionality for your entire Oh My Zsh setup, including custom plugins, themes, and configurations.
# Using the alias (if configured in .zshrc)
backup-zsh
# Or directly
~/zsh_backup/backup_zsh.sh# Navigate to your backup directory
cd ~/zsh_backup/backup_YYYYMMDD_HHMMSS
# Run the restore script
./restore.shThe backup system saves:
- Complete Oh My Zsh installation
- Your
.zshrcconfiguration file - All custom plugins
- All custom themes
- A manifest of your installed plugins
Each backup is stored in a timestamped directory:
~/zsh_backup/
└── backup_YYYYMMDD_HHMMSS/
├── .oh-my-zsh/ # Complete Oh My Zsh installation
├── .zshrc # Your zsh configuration
├── plugins/ # Custom plugins
├── themes/ # Custom themes
├── plugins_manifest.txt # List of installed plugins
└── restore.sh # Restore script
The restore script (restore.sh) will:
- Install Oh My Zsh if not present
- Restore your
.zshrcconfiguration - Restore all custom plugins
- Restore all custom themes
- Install essential plugins (zsh-autosuggestions, zsh-syntax-highlighting)
- Provide instructions for final steps
-
Regular Backups
- Run backups before making major changes
- Create backups monthly
- Backup before system upgrades
-
Version Control
- Keep multiple backups for different configurations
- Use the timestamp to identify when each backup was created
-
System Migration
- Copy the entire backup directory to the new system
- Run the restore script in the new environment
-
Permission Denied
chmod +x ~/zsh_backup/backup_zsh.sh chmod +x ~/zsh_backup/backup_*/restore.sh
-
Missing Plugins
- Check the plugins_manifest.txt file
- Manually install any missing plugins
-
Restore Fails
- Ensure Oh My Zsh is installed
- Check for sufficient disk space
- Verify file permissions
# List all backups
ls -l ~/zsh_backup/
# Remove old backups (example: older than 30 days)
find ~/zsh_backup/ -type d -name "backup_*" -mtime +30 -exec rm -rf {} \;The backup script can be updated by editing:
vim ~/zsh_backup/backup_zsh.sh- Omair Afzal
- Github: @omair445