data backup cleanup

This commit is contained in:
2026-01-11 03:20:35 +01:00
parent 9b1a819cd1
commit 4e5914eb1e
14 changed files with 72 additions and 2 deletions

View File

@@ -0,0 +1,17 @@
Inspired by the [blog](https://www.ericbette.com/configuring-a-remote-backup-solution-using-restic-and-rclone)
# List of commands:
## Installation
- Install restic and rclone baremetal
## Setting up rclone:
- run: rclone config or follow the instructions on the provider (infomaniak in my case)
- run: rclone listremotes to confirm the server link creation
## Setting up backup repository with restic
- Save password in env variable, by running: echo export RESTIC_PASSWORD=my_password >> ~/.zshrc
- Initialize repository: restic -r rclone:example-remote:example-repo init
- Run the backup: restic -r rclone:example-remote:example-repo --verbose backup /path/to/backup
- List the snapshots: restic -r rclone:example-remote:example-repo snapshots
- Restore the backup: restic -r rclone:example-remote:example-repo restore latest --target /target --path "/target"

View File

@@ -0,0 +1,5 @@
LOG_FILE="/home/node/.n8n/external-scripts/data-backup/logs/log.log"
echo "------------------------------------------------------------------------" >> "$LOG_FILE"
echo "$(date) - Script for calendars-contact started" >> "$LOG_FILE"
restic -r rclone:sb_project_SBI-CW231949:calendars-contacts backup /home/node/.n8n/data/calendars-contacts >> "$LOG_FILE"
restic -r rclone:sb_project_SBI-CW231949:calendars-contacts forget --keep-last 3 --prune >> "$LOG_FILE"

View File

@@ -0,0 +1,5 @@
LOG_FILE="/home/node/.n8n/external-scripts/data-backup/logs/log.log"
echo "------------------------------------------------------------------------" >> "$LOG_FILE"
echo "$(date) - Script for databases started" >> "$LOG_FILE"
restic -r rclone:sb_project_SBI-CW231949:databases backup /home/node/.n8n/database >> "$LOG_FILE"
restic -r rclone:sb_project_SBI-CW231949:databases forget --keep-last 3 --prune >> "$LOG_FILE"

View File

@@ -0,0 +1,6 @@
LOG_FILE="/home/node/.n8n/external-scripts/data-backup/logs/log.log"
echo "------------------------------------------------------------------------" >> "$LOG_FILE"
echo "$(date) - Script for documents started" >> "$LOG_FILE"
restic -r rclone:sb_project_SBI-CW231949:documents backup /home/node/.n8n/data/documents >> "$LOG_FILE"
restic -r rclone:sb_project_SBI-CW231949:documents forget --keep-last 3 --prune >> "$LOG_FILE"

View File

@@ -0,0 +1,5 @@
LOG_FILE="/home/node/.n8n/external-scripts/data-backup/logs/log.log"
echo "------------------------------------------------------------------------" >> "$LOG_FILE"
echo "$(date) - Script for music started" >> "$LOG_FILE"
restic -r rclone:sb_project_SBI-CW231949:music backup /home/node/.n8n/data/media/music >> "$LOG_FILE"
restic -r rclone:sb_project_SBI-CW231949:music forget --keep-last 3 --prune >> "$LOG_FILE"

View File

@@ -0,0 +1,5 @@
LOG_FILE="/home/node/.n8n/external-scripts/data-backup/logs/log.log"
echo "------------------------------------------------------------------------" >> "$LOG_FILE"
echo "$(date) - Script for notes started" >> "$LOG_FILE"
restic -r rclone:sb_project_SBI-CW231949:notes backup /home/node/.n8n/data/notes >> "$LOG_FILE"
restic -r rclone:sb_project_SBI-CW231949:notes forget --keep-last 3 --prune >> "$LOG_FILE"

View File

@@ -0,0 +1,5 @@
LOG_FILE="/home/node/.n8n/external-scripts/data-backup/logs/log.log"
echo "------------------------------------------------------------------------" >> "$LOG_FILE"
echo "$(date) - Script for passwords started" >> "$LOG_FILE"
restic -r rclone:sb_project_SBI-CW231949:passwords backup /home/node/.n8n/data/passwords >> "$LOG_FILE"
restic -r rclone:sb_project_SBI-CW231949:passwords forget --keep-last 3 --prune >> "$LOG_FILE"

View File

@@ -0,0 +1,5 @@
LOG_FILE="/home/node/.n8n/external-scripts/data-backup/logs/log.log"
echo "------------------------------------------------------------------------" >> "$LOG_FILE"
echo "$(date) - Script for pictures started" >> "$LOG_FILE"
restic -r rclone:sb_project_SBI-CW231949:pictures backup /home/node/.n8n/data/media/pictures >> "$LOG_FILE"
restic -r rclone:sb_project_SBI-CW231949:pictures forget --keep-last 3 --prune >> "$LOG_FILE"