diff --git a/.gitignore b/.gitignore index c265584..55a58f3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,9 @@ # Docker volume mounts */*-data/ +# envfiles +.env + # backups *.tar diff --git a/cuddlefish/backup b/cuddlefish/backup index c7aac00..ea56d23 100755 --- a/cuddlefish/backup +++ b/cuddlefish/backup @@ -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. diff --git a/cuddlefish/docker-compose.yaml b/cuddlefish/docker-compose.yaml index 6f2a163..4e1656b 100644 --- a/cuddlefish/docker-compose.yaml +++ b/cuddlefish/docker-compose.yaml @@ -6,7 +6,7 @@ networks: services: server: - image: gitea/gitea:latest + image: gitea/gitea:1.19.3 container_name: gitea environment: USER_UID: 1000 diff --git a/cuddlefish/example.env b/cuddlefish/example.env new file mode 100644 index 0000000..f3f209a --- /dev/null +++ b/cuddlefish/example.env @@ -0,0 +1,3 @@ +BACKUP_HOST=bob@1.2.3.4 +BACKUP_KEYPATH=~/.ssh/id_backup +BACKUP_SSH_PORT=22