documentation review

This commit is contained in:
2022-09-30 22:38:40 +01:00
parent 9b76a0f537
commit 81c284fc18
2 changed files with 42 additions and 0 deletions

View File

@@ -0,0 +1,39 @@
#!/bin/bash
# Script example for creating a dump
# required environment variables:
# DB_BACKUP_TARGETFOLDER
# DB_HOST
# DB_USER
# DB_PASSWORD
# DB_NAME
# Duplicati UI configure as a pre script
# donwload from git
# curl https://git.limbosolutions.com/kb/duplicati/raw/branch/main/docker/scripts/backupdb.sh > backupdb.sh | chmod +x backupdb.sh
set -e
if [ -z ${DB_BACKUP_TARGETFOLDER} ]
then
echo "\$DB_BACKUP_TARGETFOLDER cannot be empty empty"
exit -1
fi
TARGETFILENAME=db_dump_$(date -d "today" +"%Y%m%d%H%M%S").sql
if [ -f /tmp/${TARGETFILENAME} ]
then
rm /tmp/${TARGETFILENAME}
fi
mysqldump -h ${DB_HOST} --user=${DB_USER} -p"${DB_PASSWORD}" ${DB_NAME} > /tmp/${TARGETFILENAME}
if [ x$(find "$DB_BACKUP_TARGETFOLDER" -prune -empty) = x"$DB_BACKUP_TARGETFOLDER" ]; then
echo "folder is empty... ignoring clean db dump folder"
else
rm -r ${DB_BACKUP_TARGETFOLDER}/*
fi
mv /tmp/${TARGETFILENAME} ${DB_BACKUP_TARGETFOLDER}/${TARGETFILENAME}

View File

@@ -0,0 +1,3 @@
FROM duplicati/duplicati
RUN apt update && apt install -y default-mysql-client && rm -rf /var/lib/apt/lists/*
EXPOSE 8200