|
| 1 | +<div align="center"> |
| 2 | + <br> |
| 3 | + <a href="#quick-start"> |
| 4 | + <img src="https://img.shields.io/badge/MAC_MEDIA_STACK_BACKUP-00C853?style=for-the-badge&logo=apple&logoColor=white" alt="Mac Media Stack Backup" height="40" /> |
| 5 | + </a> |
| 6 | + <br><br> |
| 7 | + <strong>Automated backup and restore for your *arr Docker stack on macOS</strong> |
| 8 | + <br> |
| 9 | + <sub>Your Sonarr database will corrupt eventually. Your config will vanish after a bad update.<br>This runs nightly so you never lose more than a day.</sub> |
| 10 | + <br><br> |
| 11 | + <img src="https://img.shields.io/badge/Docker-2496ED?style=flat-square&logo=docker&logoColor=white" /> |
| 12 | + <img src="https://img.shields.io/badge/OrbStack-000000?style=flat-square&logo=data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48Y2lyY2xlIGN4PSIxMiIgY3k9IjEyIiByPSIxMCIgZmlsbD0id2hpdGUiLz48L3N2Zz4=&logoColor=white" /> |
| 13 | + <img src="https://img.shields.io/badge/macOS-000000?style=flat-square&logo=apple&logoColor=white" /> |
| 14 | + <img src="https://img.shields.io/badge/Bash-4EAA25?style=flat-square&logo=gnubash&logoColor=white" /> |
| 15 | + <br><br> |
| 16 | + <img src="https://img.shields.io/github/stars/liamvibecodes/mac-media-stack-backup?style=flat-square&color=yellow" /> |
| 17 | + <img src="https://img.shields.io/github/license/liamvibecodes/mac-media-stack-backup?style=flat-square" /> |
| 18 | + <br><br> |
| 19 | +</div> |
| 20 | + |
| 21 | +## Why Backup? |
| 22 | + |
| 23 | +You will lose your Sonarr database at some point. A failed Docker update, a corrupt SQLite file, an accidental `docker compose down -v`. When it happens, you lose all your series, quality profiles, custom formats, indexer configs, and download history. Rebuilding takes hours. |
| 24 | + |
| 25 | +This tool backs up configs, databases, and compose files every night. When something breaks, you restore in one command and you're back to where you were yesterday. |
| 26 | + |
| 27 | +## What It Backs Up |
| 28 | + |
| 29 | +| Item | Details | |
| 30 | +|------|---------| |
| 31 | +| **Config files** | config.xml, config.yml, settings.json, *.conf from each service | |
| 32 | +| **Databases** | All *.db files (Sonarr, Radarr, Prowlarr, Lidarr, Bazarr, etc.) | |
| 33 | +| **Compose file** | docker-compose.yml | |
| 34 | +| **Environment** | .env (sensitive values redacted) | |
| 35 | +| **Container state** | Snapshot of running containers at backup time | |
| 36 | + |
| 37 | +Backups are compressed tarballs stored in `~/Media/backups/`. Old backups are pruned automatically (default: keep 14 days). |
| 38 | + |
| 39 | +## Quick Start |
| 40 | + |
| 41 | +```bash |
| 42 | +git clone https://github.com/liamvibecodes/mac-media-stack-backup.git |
| 43 | +cd mac-media-stack-backup |
| 44 | +bash backup.sh |
| 45 | +``` |
| 46 | + |
| 47 | +## Scheduled Backups |
| 48 | + |
| 49 | +Install a nightly backup at 2am: |
| 50 | + |
| 51 | +```bash |
| 52 | +bash install.sh |
| 53 | +``` |
| 54 | + |
| 55 | +Customize the schedule: |
| 56 | + |
| 57 | +```bash |
| 58 | +bash install.sh --hour 3 # run at 3am instead |
| 59 | +``` |
| 60 | + |
| 61 | +Remove the scheduled backup: |
| 62 | + |
| 63 | +```bash |
| 64 | +bash install.sh --uninstall |
| 65 | +``` |
| 66 | + |
| 67 | +## Restore |
| 68 | + |
| 69 | +List available backups: |
| 70 | + |
| 71 | +```bash |
| 72 | +bash restore.sh --list |
| 73 | +``` |
| 74 | + |
| 75 | +Restore the most recent backup: |
| 76 | + |
| 77 | +```bash |
| 78 | +bash restore.sh --latest |
| 79 | +``` |
| 80 | + |
| 81 | +Restore a specific backup: |
| 82 | + |
| 83 | +```bash |
| 84 | +bash restore.sh 20260222-020000 |
| 85 | +``` |
| 86 | + |
| 87 | +The restore process stops your containers, copies configs and databases back, restarts everything, and runs a health check. |
| 88 | + |
| 89 | +**Note:** .env values are redacted in backups for security. After restoring, check your .env file and re-add any secrets if needed. |
| 90 | + |
| 91 | +## Custom Media Path |
| 92 | + |
| 93 | +All scripts default to `~/Media`. Use `--path` for a different location: |
| 94 | + |
| 95 | +```bash |
| 96 | +bash backup.sh --path /Volumes/External/Media |
| 97 | +bash restore.sh --latest --path /Volumes/External/Media |
| 98 | +``` |
| 99 | + |
| 100 | +## Works With |
| 101 | + |
| 102 | +- [mac-media-stack](https://github.com/liamvibecodes/mac-media-stack) — One-command Plex + Sonarr + Radarr setup |
| 103 | +- [mac-media-stack-advanced](https://github.com/liamvibecodes/mac-media-stack-advanced) — Power-user setup with transcoding, quality profiles, and automation |
| 104 | + |
| 105 | +## Author |
| 106 | + |
| 107 | +Built by [@liamvibecodes](https://github.com/liamvibecodes) |
| 108 | + |
| 109 | +## License |
| 110 | + |
| 111 | +[MIT](LICENSE) |
0 commit comments