LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 02-05-2011, 04:56 AM   #16
dinakumar12
Member
 
Registered: Mar 2010
Location: INDIA (chennai)
Distribution: centos
Posts: 271

Original Poster
Blog Entries: 7

Rep: Reputation: 18

Hi choogendyk,

Thanks, Now i got a different question which one is the best for back up tar or rsync.

My case is whenever needed, i have to restore with cent percent datas. So which one would be better among these two.
 
Old 02-05-2011, 02:56 PM   #17
choogendyk
Senior Member
 
Registered: Aug 2007
Location: Massachusetts, USA
Distribution: Solaris 9 & 10, Mac OS X, Ubuntu Server
Posts: 1,197

Rep: Reputation: 105Reputation: 105
Both. And cpio. And Amanda. And ZRM for MySQL.

I don't mean to be flip, but neither is better, overall, than the other. They are different and suitable to different situations. I use all of the backup tools and software mentioned above, and I look for redundancy in my backups.

I use rsync, as needed, to keep large radmind directories synchronized between servers in different buildings. That doesn't run automatically. It is in a script run by hand when radmind directories have been updated on one of the servers, tested, and found to be all right. Those changes are then rsync'ed to the other servers.

I use cpio in a script that finds files that have been changed in the administrative offices' home directories, pipes the list of files to cpio, and sticks it in a daily incremental backup directory on an archive partition where they are kept for 10 days.

I use tar to backup my Amanda home directory, along with indexes and configuration files, to another server right after Amanda completes it's daily backups. Again, those are kept for 10 days. It happens that all that stuff is also backed up by Amanda to tapes on the other server, so I can pick it up going back a few months.

I use Amanda for my routine daily backups of all the servers across the network (for multiple departments), with a tape cycle that goes back a few months. Amanda, in turn, uses ufsdump underneath on Solaris servers with ufs file systems, and gtar on linux systems and Solaris systems with zfs file systems. While that catches the MySQL data directories, it is not safe to rely on these backups for MySQL. They may work much of the time for MyIASM, but they will fail sometimes, and they will not work for InnoDB.

ZRM for MySQL integrates all the proper methods for backing up MySQL. If you set it up, it will manage the backup of the full database using appropriate methods such as mysqldump after flushing and locking tables and it will use the binary log file to handle incremental backups. It puts all the resulting backup files in a directory on disk. If you set it up on another server, it will access your MySQL server and the backups will be on the other server. If you configure Amanda to catch that directory, and you schedule things so that ZRM runs before Amanda, then you will have those backups out to tape, disk (virtual tapes), or the cloud (S3).

I also use root disk mirroring and data array zfs raidz2 (equivalent to raid6) with a hot spare. The zfs file system allows me to use daily snapshots for important things.

All of these together give you the kind of redundancy that assures you that you won't lose anything (with very good probability ).
 
1 members found this post helpful.
Old 02-07-2011, 02:27 AM   #18
dinakumar12
Member
 
Registered: Mar 2010
Location: INDIA (chennai)
Distribution: centos
Posts: 271

Original Poster
Blog Entries: 7

Rep: Reputation: 18
Hi choogendyk,

I am using this code for backing up a particular folder in my server,which consists of important documents and will be changed regularly.


rsync -a -t -r -v --delete source/ destination/

Assume that i am running this code in cron for every minute. This would allow me to restore with almost cent percent data during system crash, as i will be having latest backup.

But if need to restore with one hour before data,its not possible.

I was thinking of using tar, but if i use tar to compress the files differentially. then the count of back up files grow larger as i am executing this tar option for every minute.

So Kindly post your suggestion. For me rsync seems to be some what better, But i am having that above mentioned draw back in rsync.

Kinldy share what would be your approach for this scenario.

Last edited by dinakumar12; 02-07-2011 at 02:30 AM.
 
Old 02-07-2011, 07:12 AM   #19
choogendyk
Senior Member
 
Registered: Aug 2007
Location: Massachusetts, USA
Distribution: Solaris 9 & 10, Mac OS X, Ubuntu Server
Posts: 1,197

Rep: Reputation: 105Reputation: 105
We're getting off track from your original question of copying /var/lib/mysql, but what you are talking about here (rsync every short amount of time) sounds like snapshots. The difficulty you have pointed out is that you are basically overwriting the previous snapshot every time you do a new one.

The solution gets a little more complicated. The classic explanation of how to do it is http://www.mikerubel.org/computers/rsync_snapshots/. There are also a number of rsync based scripts or applications that do that, including http://rsnapshot.org/, http://www.ubuntugeek.com/flyback-sn...-on-rsync.html, http://linuxbackups.org/node/25, http://search.cpan.org/~mikeh/Snapba...up/Snapback.pm, and others, as well as offshoots like http://www.hawaga.org.uk/ben/tech/snaprotate/. Google knows more.

Doing a snapshot every minute seems kind of over the top. Depending on the size and number of files, it could get out of hand pretty quickly. You'll have to decide whether it is really worth the trouble to do it that often and how to deal with the accumulating snapshots.
 
Old 02-10-2011, 04:01 AM   #20
dinakumar12
Member
 
Registered: Mar 2010
Location: INDIA (chennai)
Distribution: centos
Posts: 271

Original Poster
Blog Entries: 7

Rep: Reputation: 18
Hi choogendyk,

Will try that and let you know the status. Thanks for all your suggestions.
 
  


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
ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql. NoviceW Linux - Networking 17 09-17-2014 03:13 PM
ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql. SpellChainz Linux - Software 3 06-28-2007 12:46 PM
mysql error Can't connect to local MySQL server through socket '/var/lib/mysql/mysql. SpellChainz Linux - Newbie 1 06-23-2007 04:35 PM
mysql error Can't connect to local MySQL server through socket '/var/lib/mysql/mysql. Dannux Linux - Software 3 03-24-2006 09:44 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 02:53 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration