-
-
Notifications
You must be signed in to change notification settings - Fork 8
Dots Backup
The dots backup utility provides comprehensive backup and restoration capabilities for your dotfiles configuration. This tool helps you create snapshots, manage backup schedules, and restore previous configurations when needed.
Tip
Regular backups are essential for maintaining system stability and recovering from configuration issues. The backup tool integrates seamlessly with chezmoi and your dotfiles workflow.
# Create a backup with default settings
dots backup
# List all available backups
dots backup --list
# Restore from a specific backup
dots backup --rollback
# Set up automated backups with cron
dots backup --register-cron
# Remove automated backups
dots backup --unregister-cron# Custom backup location
dots backup --backup-dir=/path/to/custom/location
# Custom backup name
dots backup --backup-name=my-custom-backup
# Custom dotfiles directory (if not using default ~/.dotfiles)
dots backup --dotfiles-dir=/path/to/dotfiles
# Custom log file location
dots backup --log-file=/path/to/custom.logThe backup tool creates comprehensive snapshots including:
-
Dotfiles source: Your complete
~/.dotfilesdirectory -
Applied configurations: Key config files from
~/.config -
Shell configurations:
.zshrc,.bashrc,.profile, etc. -
SSH configurations:
~/.sshdirectory (with permission preservation) -
Git configurations:
.gitconfigand related files -
Custom scripts:
~/.local/bincontents - Application data: Selected application configurations
# Register daily backups at 2 AM
dots backup --register-cron
# This creates a cron job that runs:
# 0 2 * * * /home/user/.local/bin/dots-backup --backup-name=daily_$(date +\%Y\%m\%d)# View current cron jobs
crontab -l
# Remove automated backups
dots backup --unregister-cron
# Check backup logs
tail -f ~/.cache/dots/backup.logdots backup --listThis shows:
- Backup name and date
- Backup size
- Location on disk
- Backup integrity status
# Interactive restoration (shows available backups)
dots backup --rollback
# The restore process:
# 1. Lists available backups with timestamps
# 2. Allows you to select which backup to restore
# 3. Creates a pre-restore backup of current state
# 4. Restores selected backup
# 5. Runs chezmoi apply to sync changesDefault backup location: ~/.dotfiles/backup/
backup/
โโโ dotfiles_backup_20250109_143022/
โ โโโ dotfiles/ # Complete .dotfiles directory
โ โโโ configs/ # Applied configurations
โ โโโ ssh/ # SSH configurations (encrypted)
โ โโโ scripts/ # Custom scripts
โ โโโ metadata.json # Backup metadata and checksums
โโโ dotfiles_backup_20250108_140000/
โโโ ...
- SSH keys maintain 600 permissions
- Directories preserve 700/755 permissions
- Sensitive files are properly secured
# Backup with GPG encryption (if gpg is configured)
dots backup --encrypt
# Restore encrypted backup
dots backup --rollback --decrypt- SHA256 checksums for all backed up files
- Automatic integrity verification during restore
- Corruption detection and reporting
The backup tool uses these defaults:
-
Backup directory:
~/.dotfiles/backup -
Backup name:
dotfiles_backup_$(date) -
Log file:
/tmp/dots_backup_log_$(date).txt - Retention: Keeps last 10 backups by default
You can modify the backup script to:
- Change default retention policy
- Add/remove directories from backup scope
- Modify backup naming conventions
- Customize encryption settings
# Edit the backup script
chezmoi edit ~/.local/bin/executable_dots-backup
chezmoi apply# Ensure proper permissions for backup directory
chmod 755 ~/.dotfiles/backup# Exclude large files or directories by editing the script
# Add exclusions for cache directories, logs, etc.# Check backup integrity
dots backup --verify backup_name
# Manual restoration
cp -r ~/.dotfiles/backup/backup_name/dotfiles ~/.dotfiles-restoredIf something goes wrong:
- Current config is automatically backed up before any restore
- Use
chezmoi diffto see what changed - Use
chezmoi apply --dry-runto preview changes - Restore from the automatic pre-restore backup if needed
- Regular Backups: Set up daily automated backups
- Test Restores: Periodically test backup restoration
- Multiple Locations: Consider backing up to external storage
- Version Control: Use git for additional version tracking
- Documentation: Document any custom backup configurations
-
chezmoi archive- Create chezmoi-specific archives -
dots config-manager- Manage configuration snapshots -
dots security-audit- Audit backup security
The backup system works hand-in-hand with chezmoi to provide comprehensive configuration management and disaster recovery capabilities.
- ๐ Quickshell Shell โญ
- โ Quickshell Parity Checklist
- ๐ Thunar File Manager
- ๐ Yazi File Manager
- ๐ CopyQ Clipboard Manager
- ๐ Dots Scripts Guide โญ Complete Documentation
- ๐พ Backup System
- ๐ Eject System
Quickshell-first flows:
- ๐ App Launcher - quickshell โ minimal
- ๐ Clipboard - cliphist/copyq โ minimal
- โก Power Menu - quickshell
- โ๏ธ Settings Hub - unified GUI settings
Media & Screen:
- ๐ธ Screenshots - sss
- ๐ Screen Lock - hyprlock
- ๐ Brightness - brightnessctl
System:
- โก Performance - powerprofilesctl
- โจ๏ธ Keyboard Layout - 13 layouts
- ๐ Battery Monitor - poweralertd
- ๐ File Manager - thunar โ nautilus
- ๐ Yazi - terminal file manager
- ๐ก๏ธ Security
- ๐ฅ๏ธ Hardware
- ๐ฎ NVIDIA Troubleshooting
- โก Hybrid GPU Performance
- ๐ถ Network Manager
Essential:
- ๐ Home - Start here
- ๐ Dots Scripts โญ - All tools & fallbacks
- ๐จ Appearance Themes - Theme switching
- ๐ผ๏ธ Theme Gallery
- โ๏ธ Nix / Home-Manager - Visual theme browser
- ๐ง Smart Colors - Adaptive theming
Recent Updates:
- โญ Dots Scripts - Quickshell-first command reference
- ๐ Hybrid GPU - NVIDIA/Intel power management
- ๐ Changelog 2025 - Latest changes