XMPP JavaScript Library

Small Linux shell script to backup MySQL Database

Linux, Sachin Puri, 2012-01-27 16:29:37

This shell script can be used to take mysql database backup. To make backup process automatically you have to call this shellscript using Cron Job.

#!/bin/sh
#MySQL Database Backup Script
#-----------------------------

#Config
DB="database" #Database to backup
USER="user" #Your MySQL User
PASS="password" #Your MySQL Password
BACKUP_DIR="/root/backup" #Path to your backup directory
MYSQL_BIN_DIR="/var/mysql/bin" #Path to your MySQL bin folder
#Config

DT=`date '+%d_%b_%Y_%H_%M_%S'`
FILE=$BACKUP_DIR/$DB'_DB_BK_'$DT.sql

$MYSQL_BIN_DIR/mysqldump $DB > $FILE -u $USER -p$PASS
gzip $FILE

 

Add Your Comment
   
    Yes! I want to receive all comments by email

  by asas on 25-Mar-2019 11:01 am
Great post, and great website. Thanks for the information! MAKING AD BOARD
  • Reply
  •  0 Like
  •  0 Dislike
  • Report
  by sas on 23-Mar-2019 03:56 pm
You know your projects stand out of the herd. There is something special about them. It seems to me all of them are really brilliant! ac unit
  • Reply
  •  0 Like
  •  0 Dislike
  • Report
  by asas on 22-Mar-2019 02:54 pm
You know your projects stand out of the herd. There is something special about them. It seems to me all of them are really brilliant! pozycjonowanie stron www
  • Reply
  •  0 Like
  •  0 Dislike
  • Report
  by sas on 22-Mar-2019 11:02 am
I love the way you write and share your niche! Very interesting and different! Keep it coming! click here
  • Reply
  •  0 Like
  •  0 Dislike
  • Report
  by asa on 20-Mar-2019 06:52 pm
Interesting and amazing how your post is! It Is Useful and helpful for me That I like it very much, and I am looking forward to Hearing from your next.. attorney for car accident
  • Reply
  •  0 Like
  •  0 Dislike
  • Report
  by asa on 20-Mar-2019 12:51 pm
You know your projects stand out of the herd. There is something special about them. It seems to me all of them are really brilliant! Buy Orlistat (Xenical) online
  • Reply
  •  0 Like
  •  0 Dislike
  • Report
  by Pamela Bennett on 17-Mar-2019 05:44 pm
I can’t imagine focusing long enough to research; much less write this kind of article. You’ve outdone yourself with this material. This is great content. cheap locksmith Gilbert
  • Reply
  •  0 Like
  •  0 Dislike
  • Report
  by a on 17-Mar-2019 03:40 pm
Thanks for your post. I’ve been thinking about writing a very comparable post over the last couple of weeks, I’ll probably keep it short and sweet and link to this instead if thats cool. Thanks. buy Methylphenidate online
  • Reply
  •  0 Like
  •  0 Dislike
  • Report
  by asa on 13-Mar-2019 10:02 pm
I love the way you write and share your niche! Very interesting and different! Keep it coming! Peter o Halloran
  • Reply
  •  0 Like
  •  0 Dislike
  • Report
  by asas on 12-Mar-2019 04:09 pm
I love the way you write and share your niche! Very interesting and different! Keep it coming! papel de parede infantil masculino
  • Reply
  •  0 Like
  •  0 Dislike
  • Report
  by asa on 11-Mar-2019 05:49 pm
It proved to be Very helpful to me and I am sure to all the commentators here! check here
  • Reply
  •  0 Like
  •  0 Dislike
  • Report
  by asas on 10-Mar-2019 10:08 pm
Type your comment...Great write-up, I am a big believer in commenting on blogs to inform the blog writers know that they’ve added something worthwhile to the world wide web!.. Roofing contractor
  • Reply
  •  0 Like
  •  0 Dislike
  • Report
  by asa on 08-Mar-2019 01:26 pm
I can see that you are an expert at your field! I am launching a website soon, and your information will be very useful for me.. Thanks for all your help and wishing you all the success in your business. Here
  • Reply
  •  0 Like
  •  0 Dislike
  • Report
  by aa on 08-Mar-2019 12:23 am
I can see that you are an expert at your field! I am launching a website soon, and your information will be very useful for me.. Thanks for all your help and wishing you all the success in your business. college papers
  • Reply
  •  0 Like
  •  0 Dislike
  • Report
  by aa on 07-Mar-2019 08:24 pm
It proved to be Very helpful to me and I am sure to all the commentators here! sports kerala
  • Reply
  •  0 Like
  •  0 Dislike
  • Report
  by as on 07-Mar-2019 12:41 pm
Very useful post. This is my first time i visit here. I found so many interesting stuff in your blog especially its discussion. Really its great article. Keep it up. Traffic Ivy Boost Social Signals
  • Reply
  •  0 Like
  •  0 Dislike
  • Report
  by sas on 06-Mar-2019 02:33 pm
It proved to be Very helpful to me and I am sure to all the commentators here! writing help
  • Reply
  •  0 Like
  •  0 Dislike
  • Report
  by Anna Sally on 05-Mar-2019 09:48 pm
Type your comment...This article is an appealing wealth of useful informative that is interesting and well-written. I commend your hard work on this and thank you for this information. I know it very well that if anyone visits your blog, then he/she will surely revisit it again. Arvada CO locksmith
  • Reply
  •  0 Like
  •  0 Dislike
  • Report
  by sd on 05-Mar-2019 06:50 pm
It proved to be Very helpful to me and I am sure to all the commentators here! Buy Instagram Followers
  • Reply
  •  0 Like
  •  0 Dislike
  • Report
  by Mark Bates on 02-Mar-2019 04:34 pm
Remarkable article, it is particularly useful! I quietly began in this, and I'm becoming more acquainted with it better! Delights, keep doing more and extra impressive! Boulder locksmith
  • Reply
  •  0 Like
  •  0 Dislike
  • Report
  by hyder ali on 28-Feb-2019 01:55 pm
This is very educational content and written well for a change. It's nice to see that some people still understand how to write a quality post! INVISALIGN
  • Reply
  •  0 Like
  •  0 Dislike
  • Report
  by cadd on 26-Feb-2019 11:54 am
You know your projects stand out of the herd. There is something special about them. It seems to me all of them are really brilliant! agen domino qq
  • Reply
  •  0 Like
  •  0 Dislike
  • Report
  by dasd on 25-Feb-2019 11:17 pm
Very useful post. This is my first time i visit here. I found so many interesting stuff in your blog especially its discussion. Really its great article. Keep it up. essay writing service
  • Reply
  •  0 Like
  •  0 Dislike
  • Report
  by csad on 25-Feb-2019 11:26 am
Very useful post. This is my first time i visit here. I found so many interesting stuff in your blog especially its discussion. Really its great article. Keep it up. Artificial grass Dubai
  • Reply
  •  0 Like
  •  0 Dislike
  • Report
  by Anonymous on 28-Jan-2012 08:49 pm
Thanks for the script.
  • Reply
  •  8 Like
  •  3 Dislike
  • Report