linux快速省时省力搬家教程

/ 3评 / 12

这篇教程来源于:Wait li 的运维笔记 首先给服务器添加免密 在老服务器上执行这个命令 ssh-keygen 之后一路回车下去 就ok。 如下所示:

root@logstash01 ~]# ssh-keygen  
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa): 
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
b0:f5:8a:f6:c3:f5:85:cf:9c:f7:55:28:15:ba:4c:60 root@logstash01
The key's randomart image is:
+--[ RSA 2048]----+
|          E   .  |
|         . . . . |
|      . .   o .  |
|       + . o o . |
|      . S . +.. .|
|       . .. ... .|
|      o... . = ..|
|     . .o   . = o|
|        ..     .o|
+-----------------+
[root@logstash01 ~]# 

执行 ssh-copy-id 192.168.10.11 192.168.10.11是新站的IP 然后输入yes和输入密码 然后就可以进行数据同步了 

nohup `tar -c /home/wwwroot/www.test.com/ |gzip |ssh -c aes128-ctr 192.168.10.11 "gzip -d|tar -xC /" ` &

欢迎使用WordPress。这是您的第一篇文章。编辑或删除它,然后开始写作吧!

  1. 嗨,这是一条评论。
    要开始审核、编辑及删除评论,请访问仪表盘的“评论”页面。
    评论者头像来自Gravatar

  2. Tokin说道:

    咋搬完家还顺便清空了。。。

发表评论

邮箱地址不会被公开。 必填项已用*标注