Bash Script for Daily backup of MySQL Database

In what way to plan MySQL database backup. A bash script for MySQL database backup. In this blog, you will discover a modest bash script, which receipts the backup of MySQL database and stock on the local system. This script will also to take away older backups from disk to free space. You can also custom this blog to backup MySQL database and stock a copy on the remote FTP server

Backup Script

Now, copy the subsequent content in a script file (like: /home/ubuntu/ and save on your Ubuntu system. Change the variable values in the script as per your requirements.

After producing or downloading script make certain to set execute permission to run correctly.

Schedule Script in Crontab

Now schedule the script in crontab to run daily and whole backup on consistent basis. Edit crontab on your system with crontab -e command. Add subsequent settings to enable backup at 9pm in the night.

Save your crontab file. After allowing cron, the script will take backup routinely, But keep check backups on a weekly or monthly basis to make sure.


Recent Posts

See All

Deleting Duplicate Rows in MySQL

In this blog, you will study several ways to delete duplicate rows in MySQL. In this blog, I have shown you how to find duplicate values in a table. Once the duplicates rows are recognized, you may ne


T: +44 7825018241

Follow me


© 2020 by GoplarDB 

All Rights Reserved

Powered by: Goplar LTD

  • LinkedIn Social Icon
  • Twitter Clean