jumpserver/utils/backup_db.sh

11 lines
210 B
Bash
Executable File

#!/bin/bash
#
backup_dir='../data/backup/'
if [ ! -d $backup_dir ];then
mkdir $backup_dir
fi
mysqldump -uroot -h127.0.0.1 -p jumpserver -P3307 > ${backup_dir}/jumpserver_$(date +'%Y-%m-%d_%H:%M:%S').sql