Latest LQ Deal: Latest LQ Deals
Go Back > Forums > Linux Forums > Linux - Software
User Name
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.


  Search this Thread
Old 07-19-2006, 08:02 AM   #1
LQ Newbie
Registered: Feb 2004
Posts: 22

Rep: Reputation: 15
Question Local drive Backup Solution?

Hi guys.

I'm running Ubuntu 6.06 Server.

I'm looking to set up a daily cron script to perform a backup of certain important directories.

I already have all data directories (/var /etc /home) set up in a mdadm software Raid 1, but for extra redundancy I want to incrementaly backup some very important data to an extra spare drive I have, and later also to off-site. Basically in overview here is what I want to do.

- Mount/and Spin up, Spare harddrive. (mount -t ext3 /dev/hdb1 /media/hdb1)

- Daily dump MySql Tables to file, Compress the file, and copy to backup drive. (Not sure how to do this in Command line.)

- Daily Perform an incremental backup to backup drive and remove items older than 2 weeks. (Was thinking about using rdiff-backup, but can't find a way to mail the results.)

- (optionally) Weekly perform off-site incremental backup. (Probably also rdiff-backup.)

- Mail backup results (SQL, and rdiff) to a user. (Not sure how to do this, (rdiff-backup does not seem to have a built in feature for mailing results.)

- Unmount Spare drive, and spin it down. (umount /dev/hdb1 && hdparm -S 12 /dev/hdb && hdparm -f -y /dev/hdb)

If someone have suggestions or comments on how to implement this, or can suggest how to solve the mail issue, feel free, to comment.

Old 07-19-2006, 08:37 AM   #2
Senior Member
Registered: Sep 2005
Location: France
Distribution: approximately NixOS (
Posts: 1,900

Rep: Reputation: 69
Install 'mail' utility and read its manual. So your script can capture with $() the output of a program, parse it with sed/grep (or analysing $?), and echo message to pipe leading to mail with proper parameters.
Read MySQL manual for how to dump, I guess it can dump to stdout with some easy command, and redirecting it you can get file with dump.


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
Backup Solution aerogate Mandriva 2 02-20-2006 04:37 PM
Backup Solution Hexane Linux - General 6 01-23-2005 04:26 AM
I need the best backup solution dtournas Linux - Software 1 10-16-2004 06:11 AM
Backup whole hard drive solution Swift&Smart Linux - Software 1 07-24-2004 11:05 AM
Looking for a backup solution Seventh Linux - Software 2 04-27-2004 11:55 AM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 01:24 AM.

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