Added mysql backup script
This commit is contained in:
parent
033202a6a4
commit
a263b53dc3
3 changed files with 17 additions and 1 deletions
|
@ -1,6 +1,6 @@
|
|||
from debian
|
||||
|
||||
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y wget lftp
|
||||
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y wget lftp mariadb-client
|
||||
|
||||
RUN TF=`mktemp` &&\
|
||||
wget "https://hndl.urbackup.org/Client/latest/update/UrBackupUpdateLinux.sh" -O $TF &&\
|
||||
|
|
13
scripts/mysql_backup.sh
Normal file
13
scripts/mysql_backup.sh
Normal file
|
@ -0,0 +1,13 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
BACKUP_DIR="/backup/database"
|
||||
|
||||
echo
|
||||
echo "Starting to backup database"
|
||||
date
|
||||
mkdir --parents $BACKUP_DIR
|
||||
mysqldump --single-transaction --host=$MYSQL_BACKUP_HOST --user=$MYSQL_BACKUP_USER --password=$MYSQL_BACKUP_PASSWORD $MYSQL_BACKUP_DATABASE > $BACKUP_DIR/$MYSQL_BACKUP_DATABASE.sqldump
|
||||
|
||||
echo
|
||||
echo "Database backup finished"
|
||||
date
|
|
@ -4,3 +4,6 @@ if [[ -z "$DO_FTP_BACKUP" ]]; then
|
|||
sh ftp_backup.sh
|
||||
fi
|
||||
|
||||
if [[ -z "$DO_MYSQL_BACUP" ]]; then
|
||||
sh mysql_backup.sh
|
||||
fi
|
||||
|
|
Loading…
Reference in a new issue