Add fancy templating to Nextcloud backups
Because I, regrettably, do not have backups for the past like month because data got huge
This commit is contained in:
parent
c054cbec87
commit
27d8b9f88b
@ -44,8 +44,14 @@ fi
|
|||||||
# WE MAKE BACKUP NOW SERGEI
|
# WE MAKE BACKUP NOW SERGEI
|
||||||
if cd "{{ nextcloud_webroot }}"; then
|
if cd "{{ nextcloud_webroot }}"; then
|
||||||
date="$(date -Iseconds)"
|
date="$(date -Iseconds)"
|
||||||
|
{% if aws.backup_bucket is defined %}
|
||||||
|
# We have an AWS bucket to back straight up to
|
||||||
|
log "Piping data backup straight to S3"
|
||||||
|
tar czh "/var/nextcloud" --exclude "/var/nextcloud/*/files_trashbin" | aws s3 cp - "s3://{{ aws.backup_bucket }}/{{ nextcloud.url }}/{{ nextcloud.url }}-$date-data.tar.gz" --storage-class STANDARD
|
||||||
|
{% else %}
|
||||||
log "Creating data backup"
|
log "Creating data backup"
|
||||||
tar czhf "$OUTDIR/{{ nextcloud.url }}-$date-data.tar.gz" "/var/nextcloud" --exclude "/var/nextcloud/*/files_trashbin"
|
tar czhf "$OUTDIR/{{ nextcloud.url }}-$date-data.tar.gz" "/var/nextcloud" --exclude "/var/nextcloud/*/files_trashbin"
|
||||||
|
{% endif %}
|
||||||
log "Creating webroot backup"
|
log "Creating webroot backup"
|
||||||
tar czf "$OUTDIR/{{ nextcloud.url }}-$date-webroot.tar.gz" "{{ nextcloud_webroot }}"
|
tar czf "$OUTDIR/{{ nextcloud.url }}-$date-webroot.tar.gz" "{{ nextcloud_webroot }}"
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user