diff --git a/.gitignore b/.gitignore index c86e0c5..5d4a81a 100644 --- a/.gitignore +++ b/.gitignore @@ -2,7 +2,7 @@ /backup-key.txt /backup-public-key.txt /backup/ -/cloud-archive-password.txt +/cloud-archive.sh /lock /nginx/blocked.conf /venv/ diff --git a/deploy b/deploy index 8857e0f..69b7b67 100755 --- a/deploy +++ b/deploy @@ -20,7 +20,7 @@ rsync -pcv --chmod=D755,F644 --fsync --preallocate my.cnf.d/server.cnf $remote:/ rsync -rpcv --chmod=D755,F644 --fsync --preallocate php/{php.ini,php-fpm.d} $remote:/etc/php/ rsync -rpcv --chmod=D755,F644 --fsync --preallocate php-legacy/{php.ini,php-fpm.d} $remote:/etc/php-legacy/ rsync -pcv --chmod=755 --fsync --preallocate {flarum-asset-compress,flarum-deploy,remote-backup,stopforumspam-update} $remote:/usr/local/bin/ -rsync -pcv --chmod=644 --chown flarum-admin:flarum-admin --fsync --preallocate backup-public-key.txt cloud-archive-password.txt $remote:/home/flarum-admin/ +rsync -pcv --chmod=644 --chown flarum-admin:flarum-admin --fsync --preallocate backup-public-key.txt cloud-archive.sh $remote:/home/flarum-admin/ rsync -pcv --chown root:geoipupdate --chmod=F640 --fsync --preallocate GeoIP.conf $remote:/etc/GeoIP.conf rsync -prcv --chmod=D755,F644 --fsync --preallocate systemd/system/ $remote:/etc/systemd/system ssh $remote nginx -s reload diff --git a/remote-backup b/remote-backup index a024d7d..111e36f 100755 --- a/remote-backup +++ b/remote-backup @@ -10,6 +10,8 @@ mkdir remote-backup/$timestamp mariadb-dump --all-databases --single-transaction > remote-backup/$timestamp/all_databases.sql cp -r /opt/flarum remote-backup/$timestamp/flarum tar -cC remote-backup $timestamp | zstd -9 | age -r $(cat backup-public-key.txt) -o remote-backup/$timestamp.tar.zst.age -sshpass -f cloud-archive-password.txt rsync -v ./remote-backup/$timestamp.tar.zst.age pca@gateways.storage.gra.cloud.ovh.net:backup/ + +source cloud-archive.sh +swift upload --segment-size 5368709122 -H "X-Delete-After: 5184000" --object-name $timestamp.tar.zst.age backup remote-backup/$timestamp.tar.zst.age rm -rf remote-backup