1234567891011121314151617181920212223242526272829303132333435363738394041 |
- # 数据库信息 #
- db_user="dump_user"
- db_password="123654"
- db_host="172.17.176.1"
- # mysql及mysqldump的bin文件 #
- mysql="/bin/mysql"
- mysqldump="/bin/mysqldump"
- # 数据库备份文件存储的路径 #
- backup_dir="/home/shiqi/backup/"
- #数据库备份日志文件存储的路径
- logfile="/home/shiqi/backup/mysql_backup.log"
- # 要备份的数据库名 #
- all_db="$(${mysql} -u${db_user} -h${db_host} -p${db_password} -Bse 'show databases')" #查询并备份所有数据库
- #all_db="schema_test" #仅备份指定数据库
- # 要忽略的表`database.table`
- ignore_table="schema_test.table_name schema_test.table_name2"
- # 要保留的备份天数 #
- backup_day=7
- # 备份文件格式 (dd-mm-yyyy) #
- time="$(date +"%Y-%m-%d")"
- # ssh端口号 #
- ssh_port=22
- # 定义ssh auto key的文件 #
- id_rsa=/home/shiqi/.ssh/AWSKeyPairDevelopment.pem
- # 定义ssh auto username #
- id_rsa_user=ubuntu
- # 定义要同步的远程服务器的目录路径(必须是绝对路径) #
- clientPath="/home/ubuntu/backup_test"
- # 定义要镜像的本地文件目录路径 源服务器(必须是绝对路径) #
- serverPath=${backup_dir}
- # 定义生产环境的ip #
- web_ip="52.221.182.99"
|