Add scripts for updating and backing up data

This commit is contained in:
Tyler Hallada 2022-02-12 00:44:32 -05:00
parent 4d9855552b
commit eb92f7191d
3 changed files with 20 additions and 0 deletions

7
scripts/backup.sh Normal file
View File

@ -0,0 +1,7 @@
#!/bin/bash
export $(grep -v '^#' .env | xargs -d '\n')
mkdir -p backups
zip -r -9 backups/plugins.zip plugins -DF --out backups/plugins-update.zip
pg_dump -U modmapper -Fc modmapper > backups/modmapper-$(date +'%Y-%m-%d').dump
find backups/modmapper-*.dump -mtime +30 --type f --delete
rclone sync backups/* dropbox:modmapper

4
scripts/sync.sh Normal file
View File

@ -0,0 +1,4 @@
#!/bin/bash
export $(grep -v '^#' .env | xargs -d '\n')
rsync -raz -e "ssh -p ${STATIC_SERVER_PORT}" cells ${STATIC_SERVER_USER}@${STATIC_SERVER_HOST}:/srv/
rsync -raz -e "ssh -p ${STATIC_SERVER_PORT}" mods ${STATIC_SERVER_USER}@${STATIC_SERVER_HOST}:/srv/

9
scripts/update.sh Normal file
View File

@ -0,0 +1,9 @@
#!/bin/bash
mkdir -p logs
./target/release/mod-mapper &>> logs/modmapper.log
mkdir -p cells
mkdir -p mods
./target/release/mod-mapper -e cells/edits.json
./target/release/mod-mapper -c cells
./target/release/mod-mapper -s mods/mod_search_index.json
./target/release/mod-mapper -m mods