diff --git a/roles/nextcloud/templates/backup.sh b/roles/nextcloud/templates/backup.sh index 544d5fd..e1976bd 100644 --- a/roles/nextcloud/templates/backup.sh +++ b/roles/nextcloud/templates/backup.sh @@ -43,13 +43,14 @@ if cd "{{ nextcloud_webroot }}"; then trap 'sudo -u www-data ./occ maintenance:mode --off' EXIT date="$(date -Iseconds)" log "Creating data backup" - tar czf "$OUTDIR/$date-data.tar.gz" "/var/nextcloud" + tar czhf "$OUTDIR/$date-data.tar.gz" "/var/nextcloud" log "Creating webroot backup" tar czf "$OUTDIR/$date-webroot.tar.gz" "{{ nextcloud_webroot }}" log "Creating DB backup" mysqldump nextcloud --single-transaction | gzip > "$OUTDIR/$date-db.sql.gz" log "Unsetting maintenance mode" sudo -u www-data ./occ maintenance:mode --off + trap : EXIT else log "Could not change directory: $OUTDIR" return 3