update backup stuff

master
michael 2023-06-15 16:42:42 -07:00
parent 98779c5728
commit 9c1ed78fac
4 changed files with 14 additions and 5 deletions

3
.gitignore vendored
View File

@ -1,6 +1,9 @@
# Docker volume mounts
*/*-data/
# envfiles
.env
# backups
*.tar

View File

@ -1,8 +1,11 @@
#!/bin/bash
# CONTAINER_ID=b581d6283772
CONTAINER_ID=gitea
# NOTE: DEPENDING ON PERMISSIONING, YOU MAY NEED TO RUN THIS SCRIPT USING SUDO
docker commit -p $CONTAINER_ID gitea-checkpoint-latest
docker save -o gitea-checkpoint-$(date | tr '[:upper:]' '[:lower:]' | tr ' ' '_').tar checkpoint-latest
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.

View File

@ -6,7 +6,7 @@ networks:
services:
server:
image: gitea/gitea:latest
image: gitea/gitea:1.19.3
container_name: gitea
environment:
USER_UID: 1000

3
cuddlefish/example.env Normal file
View File

@ -0,0 +1,3 @@
BACKUP_HOST=bob@1.2.3.4
BACKUP_KEYPATH=~/.ssh/id_backup
BACKUP_SSH_PORT=22