Add pfSense backup utility and documentation
- Add backup-pfsense-config.sh script for automated config backups via SSH - Auto-commits backups to git with timestamped filenames - Includes validation, error handling, and troubleshooting guides - Add scripts/README.md with detailed usage and crontab examples - Add BACKUP-QUICKSTART.md for quick reference commands - Update README.md to reference automated backup workflow - Create backups/ directory structure The script tests SSH connectivity successfully to pfSense.
This commit is contained in:
68
pfsense.home.arpa/BACKUP-QUICKSTART.md
Normal file
68
pfsense.home.arpa/BACKUP-QUICKSTART.md
Normal file
@@ -0,0 +1,68 @@
|
||||
# Quick Backup Reference
|
||||
|
||||
One-liner commands to backup your pfSense configuration.
|
||||
|
||||
## Basic Commands
|
||||
|
||||
```bash
|
||||
# Navigate to the pfsense folder
|
||||
cd /Users/kenjim/workspace/src/personal/appa-net/pfsense.home.arpa
|
||||
|
||||
# Test SSH connection (no download)
|
||||
./scripts/backup-pfsense-config.sh --dry-run
|
||||
|
||||
# Backup with auto-commit to git (default)
|
||||
./scripts/backup-pfsense-config.sh
|
||||
|
||||
# Backup without auto-commit
|
||||
./scripts/backup-pfsense-config.sh -n
|
||||
|
||||
# Backup from different host
|
||||
./scripts/backup-pfsense-config.sh 192.168.1.1
|
||||
```
|
||||
|
||||
## Schedule Daily Backups
|
||||
|
||||
Add to your crontab to run at 2 AM every day:
|
||||
|
||||
```bash
|
||||
crontab -e
|
||||
```
|
||||
|
||||
Then add this line:
|
||||
```cron
|
||||
0 2 * * * cd /Users/kenjim/workspace/src/personal/appa-net/pfsense.home.arpa && ./scripts/backup-pfsense-config.sh > /tmp/pfsense-backup.log 2>&1
|
||||
```
|
||||
|
||||
Verify it was added:
|
||||
```bash
|
||||
crontab -l | grep backup-pfsense
|
||||
```
|
||||
|
||||
## View Backups
|
||||
|
||||
```bash
|
||||
# List all backups
|
||||
ls -lh backups/
|
||||
|
||||
# Show latest backup
|
||||
ls -lh backups/ | tail -1
|
||||
|
||||
# Check git history
|
||||
git log --oneline backups/
|
||||
|
||||
# See what changed in latest backup
|
||||
git show HEAD:backups/
|
||||
```
|
||||
|
||||
## Restore from Backup
|
||||
|
||||
From pfSense WebUI:
|
||||
1. **Diagnostics → Backup & Restore**
|
||||
2. **Choose File** → select backup from `backups/` folder
|
||||
3. **Restore Configuration**
|
||||
4. Reboot when prompted
|
||||
|
||||
---
|
||||
|
||||
**Last Updated**: 2026-04-22
|
||||
Reference in New Issue
Block a user