! Written entirely by AI - use at your own risk !
A lightweight menu bar backup widget for macOS that uses rsync to backup your files to a remote server (Hetzner Storage Box compatible). Built with SwiftBar for simplicity.
- Menu bar widget showing days since last backup with color-coded status
- Multiple backup jobs - backup your Mac + external drives
- Smart drive detection - external drive backups only run when connected
- Live progress view - option to see rsync output in Terminal
- Handles macOS permission quirks - treats protected system files gracefully
- Hetzner Storage Box compatible - works with port 23 and SFTP-based SSH
| Icon | Color | Meaning |
|---|---|---|
| ✓ 0d | Green | Backed up today |
| ✓ 2d | Green | Backed up 2 days ago |
| ⏱ 5d | Yellow | Getting stale (3-7 days) |
| ⚠ 10d | Red | Overdue (> 7 days) |
| ⟳ ... | Blue | Backup in progress |
| ○ -- | Gray | Never backed up |
- macOS 12+ (tested on Monterey)
- SwiftBar - menu bar app
- SSH access to your backup server
- rsync (built into macOS)
brew install --cask swiftbar# Create config directory
mkdir -p ~/.config/backup
# Copy scripts
cp scripts/backup-runner.sh ~/.config/backup/
cp scripts/setup-ssh.sh ~/.config/backup/
cp scripts/backup.conf.template ~/.config/backup/backup.conf
# Make scripts executable
chmod +x ~/.config/backup/backup-runner.sh
chmod +x ~/.config/backup/setup-ssh.sh
# Copy SwiftBar plugin
cp swiftbar/backup.1d.sh ~/Library/Application\ Support/SwiftBar/
chmod +x ~/Library/Application\ Support/SwiftBar/backup.1d.shEdit ~/.config/backup/backup.conf:
# Your server details
REMOTE_USER="your_username"
REMOTE_HOST="your_server.your-storagebox.de"
SSH_PORT=23 # Use 22 for regular servers, 23 for Hetzner Storage Box
# Backup job 1: Your home folder
JOB1_ENABLED=true
JOB1_NAME="Mac Home"
JOB1_SOURCE="$HOME"
JOB1_REMOTE_PATH="/home/computer-backup"
# Backup job 2: External drive (optional)
JOB2_ENABLED=true
JOB2_NAME="External Drive"
JOB2_SOURCE="/Volumes/MyDrive"
JOB2_REMOTE_PATH="/home/external-backup"~/.config/backup/setup-ssh.shThis will:
- Generate an SSH key (if you don't have one)
- Copy it to your server (you'll enter your password once)
- Test the connection
- Create remote backup directories
Open SwiftBar and when prompted, select this folder as your plugins directory:
~/Library/Application Support/SwiftBar/
Click the menu bar icon to:
- Backup Now - run backup silently in background
- Backup Now (show progress) - open Terminal with live rsync output
- Edit Configuration - open config file
- View Backup Log - see recent backup activity
Rename the plugin file:
backup.1d.sh- check daily (default)backup.1h.sh- check hourlybackup.30m.sh- check every 30 minutes
Edit backup.conf to add JOB3**, JOB4**, etc., then update backup-runner.sh to include them.
Edit the EXCLUDE_PATTERNS array in backup.conf to skip specific files/folders.
┌─────────────────────┐
│ SwiftBar Plugin │ ← Shows status in menu bar
│ (backup.1d.sh) │ Reads state file daily
└─────────┬───────────┘
│ User clicks "Backup Now"
▼
┌─────────────────────┐
│ backup-runner.sh │ ← Runs rsync for each job
│ │ Updates state file
└─────────┬───────────┘
│ rsync over SSH
▼
┌─────────────────────┐
│ Remote Server │ ← Your Hetzner Storage Box
│ (Hetzner, etc.) │ or any SSH server
└─────────────────────┘
This is normal! macOS protects certain Library folders (Safari, Accounts, etc.). Your important files are still being backed up. The script treats these as warnings, not failures.
Make sure the drive is mounted and the path in JOB2_SOURCE matches exactly. Check with:
ls /Volumes/- Verify your server details in
backup.conf - For Hetzner Storage Box, ensure
SSH_PORT=23 - Re-run
setup-ssh.shto reset SSH keys
If a backup was interrupted, clear the lock:
rm ~/.config/backup/backup.lock| File | Purpose |
|---|---|
~/.config/backup/backup.conf |
Your configuration |
~/.config/backup/backup.state |
Last backup status |
~/.config/backup/backup.log |
Backup logs |
~/.config/backup/backup.lock |
Prevents concurrent runs |
~/Library/Application Support/SwiftBar/backup.1d.sh |
Menu bar plugin |
MIT License - feel free to use and modify.
Built with SwiftBar and good old rsync.
