Search

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/daily_backup.sh) 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.

11 views0 comments

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

Upload Data to MySQL tables using mysqlimport

Uploading quite a lot of rows of data from a text, csv, and excel file into a MySQL table is a repetitive task for sysadmins and DBAs who are handling MySQL database. This blog clarifies 4 applied exa

Backup Databases With mysqldump Tool

In this blog, you will study how to use mysqldump tool back up MySQL databases. MySQL GUI tools such as phpMyAdmin, SQLyog and etc, normally deliver features for backup MySQL databases with ease. But,

Call

T: +44 7825018241

Follow me

 

© 2020 by GoplarDB 

All Rights Reserved

Powered by: Goplar LTD

  • LinkedIn Social Icon
  • Twitter Clean