rsync without password?
I have a database server, but I would like to make a backup of some databases every hour via rsync. How can I do that? I use MySQL and SuSE 9.x Or, how can I setup the database as a slave on the backup server? bye Ronald Wiplinger
Ronald Wiplinger wrote:
I have a database server, but I would like to make a backup of some databases every hour via rsync. How can I do that? I use MySQL and SuSE 9.x
For the rsync part, look at the documentation for ssh. You would typically append the contents of ~/xyz/.ssh/id_rsa.pub on the machine that will initiate the rsync connexion to ~/xyz/.ssh/authorized keys on the remote machine. This allows you to do as xyz $ ssh remote.machine and login without a password. rsync uses ssh and so some command like $ rsync -Cavuz -e ssh xyz@remote.machine:data/ /home/xyz/data will do the backup for you. This doesn't, however, get round the problem that a busy database server may change files during an rsync operation. You may be able to lock the whole database for the duration. -- JDL
On Wed, 17 Aug 2005 03:53 pm, Ronald Wiplinger wrote:
I have a database server, but I would like to make a backup of some databases every hour via rsync.
I use MySQL and SuSE 9.x
Best is to get the mysql to dump its databases as SQL. Then back up the SQL files via rsync. This is more robust as it gives you an ascii file, and guaranteed snapshot consistency of the DB. Every hour is a lot, you might want to see if you can do hourly incrementals (transaction logs?) and daily dumps. Check out the "dumpdb" commands and scripts in MySQL. man rsync will give you an overview of the connection methods. There are 2 that would fit in your case SSH, set up ssh keys to allow secure password free access across machines. Pros: Easy. Can initiate the process including the dumpdb command from the (presumably more secure) backup machine. Cons: Without some extra work to create a limited account it gives a full shell ie: more general access than you really need. 2) Set up the backup host as an rsync server. Pros: limits access to rsync Cons: has to be initiated from the mySQL server michaelj -- Michael James michael.james@csiro.au System Administrator voice: 02 6246 5040 CSIRO Bioinformatics Facility fax: 02 6246 5166 No matter how much you pay for software, you always get less than you hoped. Unless you pay nothing, then you get more.
Ronald Wiplinger wrote:
I have a database server, but I would like to make a backup of some databases every hour via rsync. How can I do that? I use MySQL and SuSE 9.x
Or, how can I setup the database as a slave on the backup server?
"High Performance MySQL" by Zawodny & Balling has very good descriptions both of the options you have and how to implement your chosen strategy. I strongly recommend it. Cheers, Dave
participants (4)
-
Dave Howorth
-
John D Lamb
-
Michael James
-
Ronald Wiplinger