This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# This script creates a .zip backup of gitea running inside docker and copies the backup file to the current working directory | |
echo "Creating gitea backup inside docker containter ..." | |
docker exec -u git -it -w /tmp $(docker ps -qf "name=gitea_server_1") bash -c '/app/gitea/gitea dump -c /data/gitea/conf/app.ini --file /tmp/gitea-dump.zip' | |
echo "Copying backup file from the container to the host machine ..." | |
docker cp $(docker ps -qf "name=gitea_server_1"):/tmp/gitea-dump.zip /tmp |