Rsync on a single server
henri.shustak at gmail.com
Wed Apr 28 19:20:48 MDT 2010
>>> I seem to have been successful in copying files from one of the domains to
>>> the other using the following:
>>> rsync -auvn /path/to/source/directory /path/to/destination/directory
>>> I can only assume everything new/changed was copied as I now need the mysql
>>> database copied from one domain to the other. Is it possible to copy the
>>> mysql database using rsync on the /mysql/mydomain to /mysql/myotherdomain or
>>> do I have to do something different?
>> You can use rsync if, during the rsync run, you (1) stop the MySQL
>> server on the destination so it does not get confused by external
>> changes to its files and (2) run "FLUSH TABLES WITH READ LOCK" on the
>> source so that rsync reads a consistent state. You may be better served
>> by MySQL's own replication features.
> There are a number of ways to use rsync to perform backups.
> Will you be regularly backing up these directories and databases or is this just a one one of thing?
> Would you mind clarifying your intended use of this backup? For example :
> - In the event that an important file is accidentally
> deleted, we are planning to restore this file from
> the backup.
> - Should the physical machine catch on fire, we want
> to be able to have a second machine ready to take
> over right away.
> Finally, do you have a backup policy to guide you with this project?
Sorry, you have answered this in your original email.
> One domain is the master domain and the files
> and database need to be transferred to the other domains on a regular basis.
> Site mirroring on a single server.
> You may be better served by MySQL's own replication features.
With regards the databases, I agree.
> files and database need to be transferred to the other domains on a regular basis.
Provided this would be happening automatically and you want to keep all the domains the same, you may want to consider looking at the possibility of achieving this with your within web-server.
This email is protected by LBackup, an open source backup solution.
More information about the rsync