update backup stuff
parent
98779c5728
commit
9c1ed78fac
|
@ -1,6 +1,9 @@
|
||||||
# Docker volume mounts
|
# Docker volume mounts
|
||||||
*/*-data/
|
*/*-data/
|
||||||
|
|
||||||
|
# envfiles
|
||||||
|
.env
|
||||||
|
|
||||||
# backups
|
# backups
|
||||||
|
|
||||||
*.tar
|
*.tar
|
||||||
|
|
|
@ -1,8 +1,11 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# CONTAINER_ID=b581d6283772
|
# NOTE: DEPENDING ON PERMISSIONING, YOU MAY NEED TO RUN THIS SCRIPT USING SUDO
|
||||||
CONTAINER_ID=gitea
|
|
||||||
|
|
||||||
docker commit -p $CONTAINER_ID gitea-checkpoint-latest
|
source .env
|
||||||
docker save -o gitea-checkpoint-$(date | tr '[:upper:]' '[:lower:]' | tr ' ' '_').tar checkpoint-latest
|
|
||||||
|
|
||||||
|
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:
|
services:
|
||||||
server:
|
server:
|
||||||
image: gitea/gitea:latest
|
image: gitea/gitea:1.19.3
|
||||||
container_name: gitea
|
container_name: gitea
|
||||||
environment:
|
environment:
|
||||||
USER_UID: 1000
|
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