7
This commit is contained in:
14
backup.sh
14
backup.sh
@ -279,6 +279,15 @@ main() {
|
|||||||
# Initialize backup exit code
|
# Initialize backup exit code
|
||||||
local backup_exit_code=1
|
local backup_exit_code=1
|
||||||
|
|
||||||
|
# Check backup path
|
||||||
|
log "Checking backup path..."
|
||||||
|
if [ ! -d "${CONFIG[BACKUP_PATH]}" ]; then
|
||||||
|
log "Error: Backup path does not exist: ${CONFIG[BACKUP_PATH]}"
|
||||||
|
backup_exit_code=1
|
||||||
|
elif [ ! -r "${CONFIG[BACKUP_PATH]}" ]; then
|
||||||
|
log "Error: No read permission for backup path: ${CONFIG[BACKUP_PATH]}"
|
||||||
|
backup_exit_code=1
|
||||||
|
else
|
||||||
# Test restic repository access
|
# Test restic repository access
|
||||||
log "Testing repository access..."
|
log "Testing repository access..."
|
||||||
if ! restic -r "${CONFIG[RESTIC_REPOSITORY]}" snapshots 2>&1 | tee -a "$BACKUP_LOG"; then
|
if ! restic -r "${CONFIG[RESTIC_REPOSITORY]}" snapshots 2>&1 | tee -a "$BACKUP_LOG"; then
|
||||||
@ -304,14 +313,15 @@ main() {
|
|||||||
# Add a small delay to ensure the snapshot is registered
|
# Add a small delay to ensure the snapshot is registered
|
||||||
sleep 2
|
sleep 2
|
||||||
else
|
else
|
||||||
log "Backup command completed but no snapshot was created. Check the log for details:"
|
log "Backup command completed but no snapshot was created. Full log:"
|
||||||
tail -n 5 "$BACKUP_LOG" | while read -r line; do
|
cat "$BACKUP_LOG" | while read -r line; do
|
||||||
log " $line"
|
log " $line"
|
||||||
done
|
done
|
||||||
backup_exit_code=1
|
backup_exit_code=1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
# Get snapshot information
|
# Get snapshot information
|
||||||
log "Getting snapshot information..."
|
log "Getting snapshot information..."
|
||||||
|
Reference in New Issue
Block a user