Disable setting maintenance mode on Nextcloud backups

Risky move!
This commit is contained in:
Salt 2020-06-30 06:28:49 -05:00
parent 8ee2aa91ec
commit c58b04533c

View File

@ -43,9 +43,6 @@ if (( currentbackupcount >= retention * 3 )); then
fi fi
# WE MAKE BACKUP NOW SERGEI # WE MAKE BACKUP NOW SERGEI
if cd "{{ nextcloud_webroot }}"; then if cd "{{ nextcloud_webroot }}"; then
log "Enabling maintenance mode"
sudo -u www-data ./occ maintenance:mode --on > /dev/null 2>&1
trap 'sudo -u www-data ./occ maintenance:mode --off' EXIT
date="$(date -Iseconds)" date="$(date -Iseconds)"
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"
@ -53,9 +50,6 @@ if cd "{{ nextcloud_webroot }}"; then
tar czf "$OUTDIR/{{ nextcloud_url }}-$date-webroot.tar.gz" "{{ nextcloud_webroot }}" tar czf "$OUTDIR/{{ nextcloud_url }}-$date-webroot.tar.gz" "{{ nextcloud_webroot }}"
log "Creating DB backup" log "Creating DB backup"
mysqldump nextcloud --single-transaction | gzip > "$OUTDIR/{{ nextcloud_url }}-$date-db.sql.gz" mysqldump nextcloud --single-transaction | gzip > "$OUTDIR/{{ nextcloud_url }}-$date-db.sql.gz"
log "Unsetting maintenance mode"
sudo -u www-data ./occ maintenance:mode --off > /dev/null 2>&1
trap : EXIT
else else
log "Could not change directory: $OUTDIR" log "Could not change directory: $OUTDIR"
return 3 return 3