简体   繁体   English

在外部硬盘驱动器或另一个群集上备份整个linux服务器

[英]backing up entire linux server on external hard drive or another cluster

We have a linux server for the database. 我们有一个用于数据库的linux服务器。 Most of our data are on /var/. 我们的大多数数据都在/ var /上。 I would like to backup entire directory on external hard drive or on another linux system so that if something goes wrong I can entirely replace the directory. 我想将整个目录备份到外部硬盘驱动器或另一个linux系统上,以便在出现问题时可以完全替换该目录。 Since the directory has many files, I do not want to copy and paste every time instead I like to sync them. 由于目录中包含许多文件,因此我不想每次都复制和粘贴,而希望同步它们。

Is there easy way to do that? 有没有简单的方法可以做到这一点? rsyn can do that, how do I avoid of login every time the server? rsyn可以做到这一点,如何避免每次服务器都登录? BTW I have limited knowledge of linux system. 顺便说一句,我对linux系统了解有限。

Appreciated any comments and suggestions. 感谢任何意见和建议。

Bikesh Bikesh

Rsyncing database files is not a recommended way of backing them up. 不建议使用Rsync同步数据库文件来备份它们。 I believe you have mysql running on the server. 我相信您的服务器上正在运行mysql。 In that case, you can take a full database dump in the server, using steps mentioned in following link: 在这种情况下,可以使用以下链接中提到的步骤在服务器中进行完整的数据库转储:

http://www.microhowto.info/howto/dump_a_complete_mysql_database_as_sql.html#idp134080 http://www.microhowto.info/howto/dump_a_complete_mysql_database_as_sql.html#idp134080

And, then syncing these files to your backup server. 然后,将这些文件同步到您的备份服务器。 You can use rsych command for this purpose: 您可以为此目的使用rsych命令:

http://www.tecmint.com/rsync-local-remote-file-synchronization-commands/ http://www.tecmint.com/rsync-local-remote-file-synchronization-commands/

Make sure that you have installed mysql in the backup server too. 确保在备份服务器中也安装了mysql。 You can also copy the mysql configuration file /etc/my.cnf file to the database backup server. 您也可以将mysql配置文件/etc/my.cnf文件复制到数据库备份服务器。 In case you require your database to be updated always, you can setup mysql replication. 如果您需要始终更新数据库,则可以设置mysql复制。 You can follow the below mentioned guide to do the same. 您可以按照下面提到的指南进行操作。

http://kbforlinux.blogspot.in/2011/09/setup-mysql-master-slave-replication.html http://kbforlinux.blogspot.in/2011/09/setup-mysql-master-slave-replication.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM