modmapper/scripts/backup.sh

7 lines
365 B
Bash
Raw Normal View History

#!/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
2022-02-13 04:26:45 +00:00
pg_dump -h localhost -U modmapper -Fc modmapper > backups/modmapper-$(date +'%Y-%m-%d').dump
find backups/modmapper-*.dump -mtime +30 -type f -delete
rclone sync backups ${BACKUP_SERVER_REMOTE}:${BACKUP_SERVER_BUCKET}