两台服务器合并,A服务器的数据搬家到B服务器。
 
shell命令:
 
#!/bin/sh

# Home
cd /home/
for account in `cat /root/userlist`;do
        tar cfp - $account |ssh -l root B 'cd /home/admin/A/; ta
r xfop -'
done

# Mysql
/usr/local/etc/rc.d/mysql-server.sh stop
sleep 5
cd /home/mysql/
for account in `cat /root/userlist`;do
        tar cfp - $account |ssh -l root B 'cd /home/admin/A-mysq
l/; tar xfop -'
done
/usr/local/etc/rc.d/mysql-server.sh start