LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 05-31-2007, 08:43 AM   #1
blinton25
LQ Newbie
 
Registered: Oct 2006
Posts: 10

Rep: Reputation: 0
Backup software for MySql database


Hello,

I have a MySQL database which needs to be backed up daily. I would like a copy to be placed on a removable drive and another on the file system at a time specified by me.

I used Freshmeat to take a look at what software does this function and got a number of results. I wanted a recommendation based on user experience on what I should select (I use Ubuntu).
 
Old 05-31-2007, 12:55 PM   #2
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Slackware 10.1/10.2/12, Ubuntu 12.04, Crunchbang Statler
Posts: 3,786

Rep: Reputation: 282Reputation: 282Reputation: 282
Software? A simple script, started using crontab, would be my approach.


Code:
#!/bin/bash
# save current date (read man date if you want to add time as well)
mytime=`date +%Y%m%d`

#create backup using mysqldump
mysqldump --opt yourdatabasename > /path_to_directory/yourdatabasename.$mytime.sql

# mount your removable disk (read man mount)
mount ..... 

# copy to removable disk
cp /path_to_directory/yourdatabasename.$mytime.sql /path_to_mountpoint

# unmount removable disk (read man umount)
unmount .....
If the database is big, you might want to (tar and) zip it during the copy (replace the line containing cp by the line below)
Code:
tar -cvf /path_to_mountpoint/dbbackup.$mytime.tar.gz /path_to_directory/yourdatabasename.$mytime.sql
I have not tested it. It should create a database backup (not zipped) including a date in the filename and copy or tar it to a mounted removable disk.

If the database requires a username and password for access, you have to do some reading (man mysqldump; options -u and -p)

Last edited by Wim Sturkenboom; 05-31-2007 at 12:57 PM.
 
Old 05-31-2007, 01:26 PM   #3
FMC
Member
 
Registered: May 2007
Location: São Paulo
Distribution: Gentoo & Debian
Posts: 97

Rep: Reputation: 15
Usually I just dump all databases, tar the file and copy it to some place:

to dump:
# mysqldump --all-databases > dump_backup

You can check some mysqldump options on the man page and make your own script to backup, thats not hard to do!

[]´s, FMC!
 
Old 06-01-2007, 01:11 AM   #4
blinton25
LQ Newbie
 
Registered: Oct 2006
Posts: 10

Original Poster
Rep: Reputation: 0
Hello,

In the future the process will be maintained by users with limited technical experience, so I wanted to use a GUI driven approach
 
Old 06-01-2007, 01:41 AM   #5
slimm609
Member
 
Registered: May 2007
Location: Chas, SC
Distribution: slackware, gentoo, fedora, LFS, sidewinder G2, solaris, FreeBSD, RHEL, SUSE, Backtrack
Posts: 428

Rep: Reputation: 65
phpmyadmin can do it via a web interface.
 
Old 06-01-2007, 03:40 AM   #6
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Slackware 10.1/10.2/12, Ubuntu 12.04, Crunchbang Statler
Posts: 3,786

Rep: Reputation: 282Reputation: 282Reputation: 282
Quote:
Originally Posted by blinton25
In the future the process will be maintained by users with limited technical experience, so I wanted to use a GUI driven approach
The process will be automatic, so no GUI required.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: IBM, MySQL team up on database software LXer Syndicated Linux News 0 04-25-2007 02:16 PM
MySQL :: Auto backup all newly created database Swakoo Linux - General 3 01-22-2007 09:49 PM
Backup software for Progress Database Corfy Linux - Enterprise 1 10-13-2006 06:14 AM
How to import a mysql database from backup WindowBreaker Slackware 6 03-16-2006 11:08 PM
software for adding cddb information into a local mysql database jacksonscottsly Linux - Software 1 07-09-2004 09:21 PM


All times are GMT -5. The time now is 12:34 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration