data backup cleanup
This commit is contained in:
17
scripts/data-backup/README.md
Normal file
17
scripts/data-backup/README.md
Normal 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"
|
||||
5
scripts/data-backup/backup-infomaniak-calendars-contacts.sh
Executable file
5
scripts/data-backup/backup-infomaniak-calendars-contacts.sh
Executable 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"
|
||||
5
scripts/data-backup/backup-infomaniak-databases.sh
Executable file
5
scripts/data-backup/backup-infomaniak-databases.sh
Executable 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"
|
||||
6
scripts/data-backup/backup-infomaniak-documents.sh
Executable file
6
scripts/data-backup/backup-infomaniak-documents.sh
Executable 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"
|
||||
|
||||
5
scripts/data-backup/backup-infomaniak-music.sh
Executable file
5
scripts/data-backup/backup-infomaniak-music.sh
Executable 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"
|
||||
5
scripts/data-backup/backup-infomaniak-notes.sh
Executable file
5
scripts/data-backup/backup-infomaniak-notes.sh
Executable 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"
|
||||
5
scripts/data-backup/backup-infomaniak-passwords.sh
Executable file
5
scripts/data-backup/backup-infomaniak-passwords.sh
Executable 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"
|
||||
5
scripts/data-backup/backup-infomaniak-pictures.sh
Executable file
5
scripts/data-backup/backup-infomaniak-pictures.sh
Executable 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"
|
||||
Reference in New Issue
Block a user