diff options
| -rw-r--r-- | Makefile | 4 | ||||
| -rwxr-xr-x | restic_backup.sh | 2 | ||||
| -rwxr-xr-x | setup.sh | 2 |
3 files changed, 5 insertions, 3 deletions
@@ -397,7 +397,7 @@ validate-config: echo "⚠ Excludes file missing (optional): ~/.config/restic/excludes"; \ fi; \ echo "Testing rclone connection..."; \ - if timeout 30 rclone ls backup_remote: >/dev/null 2>&1; then \ + if bash -c ". ~/.config/restic/env && timeout 60 rclone ls backup_remote:" >/dev/null 2>&1; then \ echo "✓ Rclone connection successful"; \ else \ echo "✗ Rclone connection failed"; \ @@ -421,7 +421,7 @@ validate-config: echo "⚠ Excludes file missing (optional): /etc/restic/excludes"; \ fi; \ echo "Testing rclone connection..."; \ - if timeout 30 rclone ls backup_remote: >/dev/null 2>&1; then \ + if sudo bash -c ". /root/.restic_env && timeout 60 rclone ls backup_remote:" >/dev/null 2>&1; then \ echo "✓ Rclone connection successful"; \ else \ echo "✗ Rclone connection failed"; \ diff --git a/restic_backup.sh b/restic_backup.sh index 2ace329..831d066 100755 --- a/restic_backup.sh +++ b/restic_backup.sh @@ -36,6 +36,7 @@ restic backup \ --files-from "${CONFIG_DIR}/paths" \ --exclude-file "${CONFIG_DIR}/excludes" \ --password-file "${RESTIC_PASSWORD_FILE}" \ + --option rclone.timeout=20m \ --tag daily || { echo "Error: Restic backup failed." >&2 notify "Restic Backup ($(whoami)@$(hostname))" "Backup phase failed!" 8 @@ -51,6 +52,7 @@ restic forget \ --keep-weekly 4 \ --keep-monthly 6 \ --keep-yearly 6 \ + --option rclone.timeout=20m \ --prune || { echo "Error: Restic forget/prune failed." >&2 notify "Restic Backup ($(whoami)@$(hostname))" "Prune phase failed!" 8 @@ -319,7 +319,7 @@ RCLONE_RETRIES_SLEEP=30s # Memory optimization for VPS environments RESTIC_CACHE_DIR=/tmp/restic-cache # Increase HTTP timeout for restic communicating with rclone serve -RESTIC_REST_TIMEOUT=300s +RESTIC_REST_TIMEOUT=900s GOMAXPROCS=1 EOF log "Setting permissions for $ENV_FILE to 600" |
