update backup stuff
parent
98779c5728
commit
9c1ed78fac
|
@ -1,6 +1,9 @@
|
|||
# Docker volume mounts
|
||||
*/*-data/
|
||||
|
||||
# envfiles
|
||||
.env
|
||||
|
||||
# backups
|
||||
|
||||
*.tar
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -6,7 +6,7 @@ networks:
|
|||
|
||||
services:
|
||||
server:
|
||||
image: gitea/gitea:latest
|
||||
image: gitea/gitea:1.19.3
|
||||
container_name: gitea
|
||||
environment:
|
||||
USER_UID: 1000
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
BACKUP_HOST=bob@1.2.3.4
|
||||
BACKUP_KEYPATH=~/.ssh/id_backup
|
||||
BACKUP_SSH_PORT=22
|
Loading…
Reference in New Issue