michaelnet/cuddlefish/backup

12 lines
373 B
Bash
Executable File

#!/bin/bash
# NOTE: DEPENDING ON PERMISSIONING, YOU MAY NEED TO RUN THIS SCRIPT USING SUDO
source .env
DATESTRING=$(date +"%Y-%m-%d_%H%M%S" | tr '[:upper:]' '[:lower:]' | tr ' ' '_')
ARCHIVE="gitea-data-${DATESTRING}.tar.gz"
tar -czvf $ARCHIVE gitea-data/
scp -i $BACKUP_KEYPATH -P $BACKUP_SSH_PORT $ARCHIVE $BACKUP_HOST:~/backups/
rm $ARCHIVE && echo Removed $ARCHIVE.