[mod] forgejo backup
This commit is contained in:
parent
27ecb2faab
commit
601943b190
3 changed files with 12 additions and 6 deletions
|
@ -18,7 +18,7 @@
|
||||||
set -e -u
|
set -e -u
|
||||||
|
|
||||||
# Gitea config / SQL DB backup rotation
|
# Gitea config / SQL DB backup rotation
|
||||||
CONTAINER=gitea
|
CONTAINER=forgejo
|
||||||
# Backup dir from our perspective
|
# Backup dir from our perspective
|
||||||
HOST_BACKUP_DIR=$DEST
|
HOST_BACKUP_DIR=$DEST
|
||||||
# Git repo dir from our perspective (it's outside container)
|
# Git repo dir from our perspective (it's outside container)
|
||||||
|
@ -28,14 +28,14 @@ HOST_GIT_LFS_DIR="$SRC/git/lfs"
|
||||||
# Where we work on things (host and container)
|
# Where we work on things (host and container)
|
||||||
TEMP_DIR="/tmp"
|
TEMP_DIR="/tmp"
|
||||||
|
|
||||||
GITEA_DATA_FILENAME="gitea_backup.zip"
|
GITEA_DATA_FILENAME="forgejo_backup.zip"
|
||||||
HOST_BACKUP_FILE="$DEST/$GITEA_DATA_FILENAME"
|
HOST_BACKUP_FILE="$DEST/$GITEA_DATA_FILENAME"
|
||||||
|
|
||||||
# Back up to temp files then copy on success to prevent syncing incomplete/bad files
|
# Back up to temp files then copy on success to prevent syncing incomplete/bad files
|
||||||
CONTAINER_BACKUP_FILE_TEMP="$TEMP_DIR/gitea_dump_temp.zip"
|
CONTAINER_BACKUP_FILE_TEMP="$TEMP_DIR/forgejo_dump_temp.zip"
|
||||||
docker exec -u git -i $(docker ps -qf "name=$CONTAINER") bash -c "rm -f $CONTAINER_BACKUP_FILE_TEMP"
|
docker exec -u git -i $(docker ps -qf "name=$CONTAINER") bash -c "rm -f $CONTAINER_BACKUP_FILE_TEMP"
|
||||||
|
|
||||||
echo Backing up Gitea data to $HOST_BACKUP_FILE via $CONTAINER:$CONTAINER_BACKUP_FILE_TEMP
|
echo Backing up Forgejo data to $HOST_BACKUP_FILE via $CONTAINER:$CONTAINER_BACKUP_FILE_TEMP
|
||||||
docker exec -u git -i $(docker ps -qf "name=$CONTAINER") bash -c "/app/gitea/gitea dump --skip-repository --skip-log --file $CONTAINER_BACKUP_FILE_TEMP"
|
docker exec -u git -i $(docker ps -qf "name=$CONTAINER") bash -c "/app/gitea/gitea dump --skip-repository --skip-log --file $CONTAINER_BACKUP_FILE_TEMP"
|
||||||
# copy this into backup folder (in container)
|
# copy this into backup folder (in container)
|
||||||
docker cp $CONTAINER:$CONTAINER_BACKUP_FILE_TEMP $HOST_BACKUP_FILE
|
docker cp $CONTAINER:$CONTAINER_BACKUP_FILE_TEMP $HOST_BACKUP_FILE
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
# for gitea_backup
|
# for gitea_backup
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
export SRC="/root/thedocks/gitea/data"
|
export SRC="/root/thedocks/forgejo/data"
|
||||||
export DEST="/srv/dev-disk-by-uuid-45e2e732-9e00-4a82-a7cc-9c743e033671/datastore/gitea"
|
export DEST="/srv/dev-disk-by-uuid-45e2e732-9e00-4a82-a7cc-9c743e033671/datastore/forgejo"
|
|
@ -1 +1,7 @@
|
||||||
https://forgejo.org/docs/next/admin/installation-docker/
|
https://forgejo.org/docs/next/admin/installation-docker/
|
||||||
|
|
||||||
|
# Backup
|
||||||
|
1. `. omv.profile`
|
||||||
|
2. `./backup.sh`
|
||||||
|
|
||||||
|
# Restore
|
||||||
|
|
Loading…
Add table
Reference in a new issue