exclude-list und data dir freischießen
This commit is contained in:
1 parent
6bcac443da
commit
c6cee93cf9
2 files changed
+11
-3
No files matched your search
@@ -0,0 +1 @@
|
|||||||
|
backup_all_databases_cMxNrCTVLBPrNo6qaonojeejCvCepekwssh
|
||||||
@@ -10,13 +10,16 @@
|
|||||||
# -l, --links When symlinks are encountered, recreate the symlink on the destination.
|
# -l, --links When symlinks are encountered, recreate the symlink on the destination.
|
||||||
# -h, --human-readable Output numbers in a more human-readable format.
|
# -h, --human-readable Output numbers in a more human-readable format.
|
||||||
|
|
||||||
|
SCRIPTPATH=$(dirname `realpath $0`)
|
||||||
|
cd $SCRIPTPATH
|
||||||
|
|
||||||
# rsync source -> destination
|
# rsync source -> destination
|
||||||
SOURCE_PATH=/var/www/
|
SOURCE_PATH=/var/www/
|
||||||
DEST_PATH_FILES=/mnt/bfds/rob/backup/server/spaceboyz.net/var_www
|
DEST_PATH_FILES=/mnt/bfds/rob/backup/server/spaceboyz.net/var_www
|
||||||
|
|
||||||
# ssh credentials
|
# ssh credentials
|
||||||
PORT="42523"
|
PORT="42523"
|
||||||
KEY="./sbz_keyless"
|
KEY="${SCRIPTPATH}/sbz_keyless"
|
||||||
USER_AT_HOST="rob@spaceboyz.net"
|
USER_AT_HOST="rob@spaceboyz.net"
|
||||||
|
|
||||||
# path of the database backups
|
# path of the database backups
|
||||||
@@ -28,16 +31,20 @@ SBZ_MOUNT_PATH=/home/rob/tmp_mnt
|
|||||||
## path of the nextcloud instance (on SBZ)
|
## path of the nextcloud instance (on SBZ)
|
||||||
NEXTCLOUD_PATH=/var/www/html/nextcloud
|
NEXTCLOUD_PATH=/var/www/html/nextcloud
|
||||||
|
|
||||||
EXCLUDE="--exclude backup_all_databases_cMxNrCTVLBPrNo6qaonojeejCvCepekwss"
|
EXCLUDE="--exclude-from exclude-list"
|
||||||
|
|
||||||
|
|
||||||
# mount my lxc container into my home on sbz
|
# mount my lxc container into my home on sbz
|
||||||
ssh -p $PORT -i $KEY $USER_AT_HOST "sudo mount /dev/mapper/vms-home--rob $SBZ_MOUNT_PATH"
|
ssh -p $PORT -i $KEY $USER_AT_HOST "sudo mount /dev/mapper/vms-home--rob $SBZ_MOUNT_PATH"
|
||||||
|
|
||||||
|
# grand read permissons if not given
|
||||||
|
ssh -p $PORT -i $KEY $USER_AT_HOST "sudo sudo chmod -R +rx ${SBZ_MOUNT_PATH}/var/www/html/nextcloud/data"
|
||||||
|
|
||||||
# put nextcloud into maintenance, outside the home-rob container
|
# put nextcloud into maintenance, outside the home-rob container
|
||||||
ssh -p $PORT -i $KEY $USER_AT_HOST "sudo sed -i \"s|'maintenance' => false|'maintenance' => true|g\" $SBZ_MOUNT_PATH$NEXTCLOUD_PATH/config/config.php"
|
ssh -p $PORT -i $KEY $USER_AT_HOST "sudo sed -i \"s|'maintenance' => false|'maintenance' => true|g\" $SBZ_MOUNT_PATH$NEXTCLOUD_PATH/config/config.php"
|
||||||
|
|
||||||
# rsync download from sbz
|
# rsync download from sbz
|
||||||
rsync -arlh --progress $EXCLUDE -e "ssh -p $PORT -i $KEY" $USER_AT_HOST:${SBZ_MOUNT_PATH}${SOURCE_PATH} ${DEST_PATH_FILES}
|
rsync -az --progress $EXCLUDE -e "ssh -p $PORT -i $KEY" $USER_AT_HOST:${SBZ_MOUNT_PATH}${SOURCE_PATH} ${DEST_PATH_FILES}
|
||||||
|
|
||||||
# turn off nextcloud maintenance, outside the home-rob container
|
# turn off nextcloud maintenance, outside the home-rob container
|
||||||
ssh -p $PORT -i $KEY $USER_AT_HOST "sudo sed -i \"s|'maintenance' => true|'maintenance' => false|g\" $SBZ_MOUNT_PATH$NEXTCLOUD_PATH/config/config.php"
|
ssh -p $PORT -i $KEY $USER_AT_HOST "sudo sed -i \"s|'maintenance' => true|'maintenance' => false|g\" $SBZ_MOUNT_PATH$NEXTCLOUD_PATH/config/config.php"
|
||||||
|
|||||||
Reference in new issue
Block a user