jumpserver/utils/backup_db.sh

11 lines
203 B
Bash
Raw Normal View History

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