From c83a7c9fa2696d6084673284203c01d8011f0c02 Mon Sep 17 00:00:00 2001 From: peet Date: Fri, 22 Jan 2021 13:23:31 +0100 Subject: [PATCH] Trying something --- system-backup | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/system-backup b/system-backup index cba4348..e6c0101 100644 --- a/system-backup +++ b/system-backup @@ -31,6 +31,7 @@ sudo chown -R git:git /tmp/gitea-dump/ sudo -u git /usr/local/bin/gitea dump --config /etc/gitea/app.ini --file "/tmp/gitea-dump/backup.zip" --tempdir "/tmp/gitea-dump" # Back the fuck up bro... +sudo screen -dmS backup -t backup bash -c " if [ "$1" = "-d" ] then sudo mkdir /mnt/USB/ @@ -38,16 +39,16 @@ if [ "$1" = "-d" ] sudo mkdir -p $backup_dir"/nextcloud" sudo mkdir $backup_dir"/mysql" sudo mkdir $backup_dir"/gitea" - sudo screen -dmS backup -t backup bash -c "rsync -Aarz --progress -e ssh $nextcloud_dir/ $backup_dir/nextcloud; + rsync -Aarz --progress -e ssh $nextcloud_dir/ $backup_dir/nextcloud; rsync -Aar --progress -e ssh /tmp/nextcloud.sql $backup_dir/mysql/; - rsync -Aarz --progress -e ssh /tmp/gitea-dump/backup.zip $backup_dir/gitea/" + rsync -Aarz --progress -e ssh /tmp/gitea-dump/backup.zip $backup_dir/gitea/ else # Create remote 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 -WAXart -4 --progress -e ssh /tmp/nextcloud.sql backup-user@$remote_ip:$backup_dir_remote/mysql/; + rsync -WAXart -4 --progress -e ssh /tmp/nextcloud.sql backup-user@$remote_ip:$backup_dir_remote/mysql/; rsync -WAXarzt -4 --progress -e ssh /tmp/gitea-dump/backup.zip backup-user@$remote_ip:$backup_dir_remote/gitea/ - rsync -XWAarzt -4 --progress -e ssh $nextcloud_dir/ backup-user@$remote_ip:$backup_dir_remote/nextcloud;" + rsync -XWAarzt -4 --progress -e ssh $nextcloud_dir/ backup-user@$remote_ip:$backup_dir_remote/nextcloud; fi # Start back up @@ -63,4 +64,5 @@ while true; do [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 +done" +sudo screen -R backup \ No newline at end of file