Promt user for nextcloud maintenance mode

This commit is contained in:
Johannes Schmelz 2021-01-07 23:25:25 +01:00
parent d0a6d9e956
commit 186f7176fe

View File

@ -46,23 +46,21 @@ sudo -u git /usr/local/bin/gitea dump --config /etc/gitea/app.ini --file "/tmp/g
# Create rote directory # 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 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 # 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; sudo screen -dmS backup -t backup bash -c "rsync -Aarz --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 -Aar --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/; rsync -Aarz --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
# Start back up # Start back up
sudo service apache2 start sudo service apache2 start
cd $nextcloud_dir cd $nextcloud_dir
# Prompt user if maintenance mode should stay enabled # Prompt user if maintenance mode should stay enabled
#
# while true; do while true; do
# read -p "Do you wish to leave maintenace mode enabled?" yn read -p "Do you wish to leave maintenace mode enabled? [y/n] " yn
# case $yn in case $yn in
# [Yy]* ) exit;; [Yy]* ) exit;;
# [Nn]* ) sudo -u www-data php occ maintenance:mode --off;; [Nn]* ) sudo -u www-data php occ maintenance:mode --off; break;;
# * ) echo "Please answer yes or no.";; * ) echo "Please answer yes or no.";;
# esac esac
# done done