Practical examples for everyday dotbak usage.
# Install dotbak
curl -fsSL https://raw.githubusercontent.com/darshithedpara/dotbak/main/install.sh | bash -s -- --yes
# Initialize
dotbak init
# Add your dotfiles (prompts for mode)
dotbak add ~/.zshrc
dotbak add ~/.vimrc
dotbak add ~/.bashrc
dotbak add ~/.config/nvim
# Create first snapshot
dotbak snapshot
# Check everything
dotbak status
dotbak list# Check current status
dotbak status
# See last snapshot
dotbak snapshot list# Edit your configs
vim ~/.zshrc
vim ~/.vimrc
# Test changes...
# Everything working? Create snapshot
dotbak snapshot
# Later in the day, more edits
vim ~/.bashrc
# Create another snapshot
dotbak snapshot --name end-of-day# See available snapshots
dotbak snapshot list
# Compare what changed
dotbak snapshot diff latest
# Restore from working version
dotbak snapshot restore 2025-12-01-090000
# Or restore from named snapshot
dotbak snapshot restore 2025-12-01-120000-before-experiment# Add files that rarely change
dotbak add --symlink ~/.tmux.conf
dotbak add --symlink ~/.gitconfig
# Add directory (choose mode)
dotbak add --symlink ~/.config/alacritty
# Choose [D] for directory symlink or [F] for individual files# Add a new file to symlink-tracked directory
touch ~/.config/alacritty/themes.toml
# Detect it
dotbak symlink-sync
# Found 1 new file:
# ~/.config/alacritty/themes.toml
# [A]dd / [I]gnore now / i[G]nore always / [Q]uit? a
# ✓ Added to tracking# Create portable archive
dotbak archive moving-to-new-laptop
# Archive includes EVERYTHING:
# - All config files
# - All snapshots
# - All symlinked files
# Copy archive somewhere safe:
# ~/.dotbak/archives/moving-to-new-laptop.zipOption 1: USB Drive
cp ~/.dotbak/archives/moving-to-new-laptop.zip /media/usb/Option 2: Cloud
# Upload to Dropbox, Google Drive, etc.Option 3: Network
rsync ~/.dotbak/archives/moving-to-new-laptop.zip user@new-machine:/tmp/# Install dotbak
curl -fsSL https://raw.githubusercontent.com/darshithedpara/dotbak/main/install.sh | bash -s -- --yes
# Extract archive
mkdir -p ~/.dotbak
cd ~/.dotbak
unzip /path/to/moving-to-new-laptop.zip
# Deploy everything
dotbak deploy --all --backup
# Done! All your dotfiles are set up:
# - Snapshot files copied from latest snapshot
# - Symlink files symlinked to backups# Create named snapshot
dotbak snapshot --name before-trying-zsh-plugins
# Try experimental configs
vim ~/.zshrc
# Add new plugins...
# Test it
source ~/.zshrc
# If broken, restore
dotbak snapshot restore before-trying-zsh-plugins
# If it works, create new snapshot
dotbak snapshot --name working-with-plugins# Create weekly snapshot
dotbak snapshot --name weekly-$(date +%Y-W%W)
# Clean old snapshots (keep last 10)
dotbak snapshot clean
# Create portable archive for offsite backup
dotbak archive weekly-backup-$(date +%Y-%m-%d)# Create monthly archive for cloud storage
dotbak archive monthly-$(date +%Y-%m)
# Upload to cloud
cp ~/.dotbak/archives/monthly-2025-12.zip ~/Dropbox/backups/# Create named snapshot
dotbak snapshot --name before-fedora-42-upgrade
# Create portable archive too (extra safety)
dotbak archive before-fedora-42-upgrade
# Upgrade system...
# If something breaks:
dotbak snapshot restore before-fedora-42-upgrade
# Or full restore from archive if needed
cd ~/.dotbak
rm -rf *
unzip archives/before-fedora-42-upgrade.zip
dotbak deploy --all# See diff from latest snapshot
dotbak snapshot diff latest
# Output:
# ⚠ Changed: ~/.zshrc
# ✓ No changes: ~/.vimrc# List all snapshots
dotbak snapshot list
# See details of specific snapshot
dotbak snapshot show 2025-12-01-153803
# Compare two snapshots (manual)
diff ~/.dotbak/snapshots/2025-12-01-090000/.zshrc \
~/.dotbak/snapshots/2025-12-01-170000/.zshrcUse both modes together for optimal workflow:
# Snapshot mode for files you experiment with
dotbak add --snapshot ~/.zshrc
dotbak add --snapshot ~/.vimrc
dotbak add --snapshot ~/.config/nvim
# Symlink mode for stable configs
dotbak add --symlink ~/.tmux.conf
dotbak add --symlink ~/.gitconfig
dotbak add --symlink ~/.ssh/config
# Daily workflow:
# 1. Edit snapshot-tracked files freely
vim ~/.zshrc
# 2. Create snapshot when satisfied
dotbak snapshot
# 3. Symlink files are auto-backed up
vim ~/.tmux.conf # Automatically saved!
# 4. Check status
dotbak statusIf you have your archive:
# On new system
dotbak init
cd ~/.dotbak
unzip /backup/my-dotfiles.zip
dotbak deploy --all --forceSnapshot mode:
# Restore from latest snapshot
dotbak snapshot restore latestSymlink mode:
# File is already in backup!
cd ~/.dotbak/symlinks
ls # Your file is here
# Or use deploy
dotbak deploy ~/.tmux.conf# Track your snapshots with git
cd ~/.dotbak
git init
git add config.toml snapshot.toml symlink.toml
git add snapshots/
git commit -m "My dotfiles - $(date +%Y-%m-%d)"
# Push to GitHub
git remote add origin git@github.com:username/dotfiles.git
git push -u origin main
# On new machine
git clone git@github.com:username/dotfiles.git ~/.dotbak
dotbak deploy --allDo you need version history?
├─ YES → Use Snapshot Mode
│ You want to restore old versions
│
└─ NO → Use Symlink Mode
You just want automatic backup
Snapshot Mode:
- Shell RC files (
.zshrc,.bashrc) - Experiment a lot - Editor configs (
.vimrc,init.lua) - Try plugins - App configs you frequently tweak
Symlink Mode:
- Git config (
.gitconfig) - Rarely changes - SSH config (
.ssh/config) - Stable - Terminal multiplexer (
.tmux.conf) - Set and forget
For detailed command reference, see Commands.