summaryrefslogtreecommitdiff
path: root/setup.sh
diff options
context:
space:
mode:
authorSam Scholten2025-09-11 16:24:58 +1000
committerSam Scholten2025-09-11 16:29:06 +1000
commit0556a3bf965a8972356765bd20026beaed171f30 (patch)
tree84c42a393a861b51c19850ebc490fc1e5db1b189 /setup.sh
parent8f800a72d3603ead29e072eb5dbf5af7d31eece2 (diff)
downloaddrestic-0556a3bf965a8972356765bd20026beaed171f30.tar.gz
drestic-0556a3bf965a8972356765bd20026beaed171f30.zip
unique Restic repository paths per host
Diffstat (limited to 'setup.sh')
-rwxr-xr-xsetup.sh6
1 files changed, 4 insertions, 2 deletions
diff --git a/setup.sh b/setup.sh
index 9bc9ab4..6e9c0aa 100755
--- a/setup.sh
+++ b/setup.sh
@@ -233,8 +233,10 @@ configure_rclone "$MEGA_EMAIL" "$MEGA_TEMP_PASS_FILE"
# Clean up temporary MEGA password file
rm -f "$MEGA_TEMP_PASS_FILE"
-# Define the restic repository path using the CONFIG_DIR for consistency
-RESTIC_REPO="rclone:backup_remote:/restic_backups" # This path is fixed as per plan
+# Define the restic repository path, making it unique per host for new installations.
+# This is backward-compatible; existing installations will have the old path in their env file.
+HOSTNAME_CLEANED=$(hostname | tr -cd '[:alnum:]_.-')
+RESTIC_REPO="rclone:backup_remote:/drestic_backups_${HOSTNAME_CLEANED}" # Path is now unique per host
initialize_restic_repo "$RESTIC_REPO" "$PASS_FILE"