Revert changes
This commit is contained in:
parent
c83a7c9fa2
commit
4319fe8138
@ -31,7 +31,6 @@ 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"
|
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...
|
# Back the fuck up bro...
|
||||||
sudo screen -dmS backup -t backup bash -c "
|
|
||||||
if [ "$1" = "-d" ]
|
if [ "$1" = "-d" ]
|
||||||
then
|
then
|
||||||
sudo mkdir /mnt/USB/
|
sudo mkdir /mnt/USB/
|
||||||
@ -39,16 +38,16 @@ if [ "$1" = "-d" ]
|
|||||||
sudo mkdir -p $backup_dir"/nextcloud"
|
sudo mkdir -p $backup_dir"/nextcloud"
|
||||||
sudo mkdir $backup_dir"/mysql"
|
sudo mkdir $backup_dir"/mysql"
|
||||||
sudo mkdir $backup_dir"/gitea"
|
sudo mkdir $backup_dir"/gitea"
|
||||||
rsync -Aarz --progress -e ssh $nextcloud_dir/ $backup_dir/nextcloud;
|
sudo screen -dmS backup -t backup bash -c "rsync -Aarz --progress -e ssh $nextcloud_dir/ $backup_dir/nextcloud;
|
||||||
rsync -Aar --progress -e ssh /tmp/nextcloud.sql $backup_dir/mysql/;
|
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
|
else
|
||||||
# Create remote directory
|
# 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
|
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
|
||||||
rsync -WAXart -4 --progress -e ssh /tmp/nextcloud.sql backup-user@$remote_ip:$backup_dir_remote/mysql/;
|
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 -WAXarzt -4 --progress -e ssh /tmp/gitea-dump/backup.zip backup-user@$remote_ip:$backup_dir_remote/gitea/
|
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
|
fi
|
||||||
|
|
||||||
# Start back up
|
# Start back up
|
||||||
@ -64,5 +63,4 @@ while true; do
|
|||||||
[Nn]* ) sudo -u www-data php occ maintenance:mode --off; break;;
|
[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
|
||||||
sudo screen -R backup
|
|
Loading…
Reference in New Issue
Block a user