MySQL backup implementation

This commit is contained in:
2023-02-11 11:49:22 +01:00
parent 6fa438e81e
commit 223eff0d1b
2 changed files with 18 additions and 1 deletions

12
main.sh
View File

@@ -233,6 +233,18 @@ function dockerbackup {
fi
}
function backup_db {
if [ "$db_backup" = true ]
then
echo "Backing up database..." >&2
mkdir -p $tmpdir/db
if [ "$database_type" = "mysql" ]
then
mysqldump -u "$db_username" -p"$db_password" "$db_name" > $tmpdir/db/db.sql
elif [ "$database_type" = "postgresql" ]
echo "soon"
}
function runbackup {
# init, config check
init