From 186f7176fe25dc66a64914afe502e6af4455856c Mon Sep 17 00:00:00 2001 From: peet Date: Thu, 7 Jan 2021 23:25:25 +0100 Subject: [PATCH] Promt user for nextcloud maintenance mode --- system-backup | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/system-backup b/system-backup index 9b5ec89..78d37f9 100644 --- a/system-backup +++ b/system-backup @@ -46,23 +46,21 @@ sudo -u git /usr/local/bin/gitea dump --config /etc/gitea/app.ini --file "/tmp/g # Create rote directory sudo ssh backup-user@$remote_ip mkdir -p $backup_dir_remote/gitea mkdir $backup_dir_remote/nextcloud mkdir $backup_dir_remote/mysql # copy the shit over -sudo screen -dmS backup -t backup bash -c "rsync -Aavrz --progress -e ssh $nextcloud_dir/ backup-user@$remote_ip:$backup_dir_remote/nextcloud; -rsync -Aavr --progress -e ssh /tmp/nextcloud.sql backup-user@$remote_ip:$backup_dir_remote/mysql/; -rsync -Aavrz --progress -e ssh /tmp/gitea-dump/backup.zip backup-user@$remote_ip:$backup_dir_remote/gitea/; -sudo -u www-data php occ maintenance:mode --off" -sudo screen -R backup +sudo screen -dmS backup -t backup bash -c "rsync -Aarz --progress -e ssh $nextcloud_dir/ backup-user@$remote_ip:$backup_dir_remote/nextcloud; +rsync -Aar --progress -e ssh /tmp/nextcloud.sql backup-user@$remote_ip:$backup_dir_remote/mysql/; +rsync -Aarz --progress -e ssh /tmp/gitea-dump/backup.zip backup-user@$remote_ip:$backup_dir_remote/gitea/" # Start back up sudo service apache2 start cd $nextcloud_dir # Prompt user if maintenance mode should stay enabled -# -# while true; do -# read -p "Do you wish to leave maintenace mode enabled?" yn -# case $yn in -# [Yy]* ) exit;; -# [Nn]* ) sudo -u www-data php occ maintenance:mode --off;; -# * ) echo "Please answer yes or no.";; -# esac -# done \ No newline at end of file + +while true; do + read -p "Do you wish to leave maintenace mode enabled? [y/n] " yn + case $yn in + [Yy]* ) exit;; + [Nn]* ) sudo -u www-data php occ maintenance:mode --off; break;; + * ) echo "Please answer yes or no.";; + esac +done \ No newline at end of file