brushing up backups
This commit is contained in:
parent
e9bb90f8f8
commit
2ebb2f9a64
5 changed files with 185 additions and 3 deletions
|
|
@ -53,6 +53,12 @@ trap 'log "Restarting ${SERVICE}..."; eval "$START_CMD" || true' EXIT
|
|||
# --- Dump straight into age; plaintext never touches the disk ---
|
||||
log "Writing ${ARTIFACT}..."
|
||||
{{ backup_source_dump_command }} | age -r "$RECIPIENT" -o "${ARTIFACT}.partial"
|
||||
{% if backup_source_pull_user %}
|
||||
# Match the final ownership immediately, so even a partial left by a later
|
||||
# failure is not an unreadable obstacle to the pull.
|
||||
chown root:{{ backup_source_pull_user }} "${ARTIFACT}.partial"
|
||||
chmod 640 "${ARTIFACT}.partial"
|
||||
{% endif %}
|
||||
mv "${ARTIFACT}.partial" "$ARTIFACT"
|
||||
{% if backup_source_pull_user %}
|
||||
# Readable by the pull account and nobody else. The contents are age-encrypted
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue