27 lines
839 B
Bash
Executable file
27 lines
839 B
Bash
Executable file
#!/bin/sh
|
|
|
|
currentdir=$(pwd)
|
|
|
|
cd /home/chris/nextcloud
|
|
pwd
|
|
|
|
dt=$(date +%Y-%m-%d)
|
|
echo $dt
|
|
|
|
# This creates a database dump and then we'll move that file
|
|
docker compose exec -u www-data -it app php occ maintenance:mode --on
|
|
docker compose exec -it db mysqldump --single-transaction --user="nextcloud" --password="Disciple77" nextcloud > nextcloud-sqlbk-$dt.bak
|
|
docker compose exec -u www-data -it app php occ maintenance:mode --off
|
|
|
|
rsync -avzPX nextcloud-sqlbk* chris@172.16.1.202:backups/nextcloud/
|
|
|
|
documents="/storage/nextcloud-data/data/__groupfolders/2/documents"
|
|
archive="/storage/nextcloud-data/data/__groupfolders/2/archive"
|
|
pictures="/storage/nextcloud-data/data/__groupfolders/2/pictures"
|
|
|
|
folders=($documents $pictures $archive)
|
|
|
|
for i in ${folders[*]}; do
|
|
rsync -avzPX $i chris@172.16.1.202:/storage/backups/nextcloud/
|
|
done
|