Linux shell script for database backup

后端 未结 10 1753
忘了有多久
忘了有多久 2020-12-02 04:59

I tried many scripts for database backup but I couldn\'t make it. I want to backup my database every hour.
I added files to \"/etc/cron.hourly/\" folder, changed its chm

10条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-02 05:27

    As a DBA, You must schedule the backup of MySQL Database in case of any issues so that you can recover your databases from the current backup.

    Here, we are using mysqldump to take the backup of mysql databases and the same you can put into the script.

    [orahow@oradbdb DB_Backup]$ cat .backup_script.sh

    #!/bin/bash
    # Database credentials
    user="root"
    password="1Loginxx"
    db_name="orahowdb"
    v_cnt=0
    logfile_path=/DB_Backup
    touch "$logfile_path/orahowdb_backup.log"
    # Other options
    backup_path="/DB_Backup"
    date=$(date +"%d-%b-%Y-%H-%M-%p")
    # Set default file permissions
    

    Continue Reading .... MySQL Backup

提交回复
热议问题