Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ This script automates encrypted, deduplicated backups of local directories to a
- **Multiple Operation Modes**: Supports standard backups, dry runs, integrity checks, difference summaries, and a safe, interactive restore mode.
- **Concurrency Control & Logging**: Prevents multiple instances from running simultaneously and handles its own log rotation.
- **Pre-run Validation**: Performs checks for required commands and repository connectivity before execution.
- **Cron Job Monitoring**: Optional integration with [Healthchecks.io](https://healthchecks.io) for alerts if a backup job fails to run on schedule.

-----

Expand All @@ -29,6 +30,7 @@ This script automates encrypted, deduplicated backups of local directories to a
- `sudo ./restic-backup.sh --verbose` - Run with live progress and detailed output.
- `sudo ./restic-backup.sh --dry-run` - Preview changes without creating a new snapshot.
- `sudo ./restic-backup.sh --check` - Verify repository integrity by checking a subset of data.
- `sudo ./restic-backup.sh --check-full` - Run a full check verifying all repository data.
- `sudo ./restic-backup.sh --test` - Validate configuration, permissions, and SSH connectivity.
- `sudo ./restic-backup.sh --restore` - Start the interactive restore wizard.
- `sudo ./restic-backup.sh --forget` - Manually apply the retention policy and prune old data.
Expand Down Expand Up @@ -256,6 +258,9 @@ To run the backup automatically, edit the root crontab.
# Run the retention/prune job every Sunday at 4:00 AM
0 4 * * 0 /root/scripts/backup/restic-backup.sh --forget > /dev/null 2>&1

# Cron job for a monthly full check (e.g., first Sunday of the month at 3 AM)
0 3 * * 0 [ $(date +\%d) -le 07 ] && /root/scripts/backup/restic-backup.sh --check-full > /dev/null 2>&1

```
*For pune job in your `restic-backup.conf`, set `PRUNE_AFTER_FORGET=true`.*
*For more details on how forget flag work, see the [official Restic documentation on removing snapshots](https://restic.readthedocs.io/en/stable/060_forget.html).*
Expand Down
7 changes: 7 additions & 0 deletions restic-backup.conf
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,13 @@ NTFY_PRIORITY_FAILURE=4
# Discord webhook (if enabled)
DISCORD_WEBHOOK_URL="https://discord.com/api/webhooks/your/webhook_url_here"

# restic-backup.conf

# --- Healthchecks.io ---
# URL for the "dead man's switch" service to ping on successful completion.
# Leave blank to disable.
# HEALTHCHECKS_URL="https://hc-ping.com/your-unique-uuid-here"

# --- Maintenance ---
# Run integrity check after backup
CHECK_AFTER_BACKUP=false
Expand Down
Loading