• 数据库备份小脚本


    #!/bin/bash
    BACKUP_DIR=/data/backup
    USER=root
    PASSWD=root
    mkdir $BACKUP_DIR
    #|| 如果两个操作数中有任意一个非零,则条件为真。 [
    -d $BACKUP_DIR ] || mkdir $BACKUP_DIR while true;do cat << EOF please input a number to choice your back up tool: 1.mysqldump 2.xtrabackup 3.quit EOF read -p "Your choose: " choose case "$choose" in 1) mysqldump -u$USER -P$PASSWD -A -F -E -R --single-transaction --master-data=1 --flush-privileges --triggers --default-character-set=utf8 --hex-blob > $BACKUP_DIR/fullback_$(date +%F_%T).sql;; 2) innobackupex --user=$USER --password=$PASSWD $BACKUP_DIR;; 3) echo "Bye!" && exit 2;; *) echo "choose Error !" && exit 3;; esac done
  • 相关阅读:
    java-多态
    java-继承
    java-访问修饰符
    mysql基础入门
    子查询
    多表查询
    mysql表(多对多)
    myslql主外键约束
    Sql语句分类
    Redis的一些介绍
  • 原文地址:https://www.cnblogs.com/lichenghong/p/14768995.html
Copyright © 2020-2023  润新知