Linux (while compressing and transmitting and extracting)

Source: Internet
Author: User
Tags ssh port
For example, I want to transfer the web Directory under the old VPShomewwwroot directory to the new VPS (123123123123) homewwwroot directory 1 to enter the directory cdhomewwwroot2 for compression and transmission, decompress the package for synchronization (note: By default, the new vps s linux is transmitted while compressing)
For example, I want to transfer the web Directory under the old VPS/home/wwwroot to the/home/wwwroot directory under the new VPS (123.123.123.123. go to the directory cd/home/wwwroot 2. compression, transmission, decompression, and synchronization (note: The SSH port of the new VPS is 22 by default) tar czf-web | ssh root@123.123.123.123 tar xzf--C/home/wwwroot black extensive if the new VPS port has been modified. (Modify the SSH Port method) assume that the port is modified to 8888. the command should be tar czf-web | ssh-p 8888 root@123.123.123.123 tar xzf--C/home/wwwroot copy the code and press enter (yes if yes) enter the new VPS password and so on. if there is a traffic monitoring software, you can see the new vps running ~ The database import and export can also be done similarly. of course, it is best that the two versions are the same. According to the default mysql directory installed by LNMP, the folder to be transferred is located in/usr/local/mysql/var, and the file name is the table name. For example, if you want to transfer the database named test of the old VPS to the new VPS, perform the following operations: 1. enter the directory cd/usr/local/mysql/var2. compress, transfer, decompress, and synchronize (note: The SSH port of the new VPS is 22 by default for this transmission, and the other ports are written as above) tar czf-test | ssh root@123.123.123.123 tar xzf--C/usr/local/mysql/var
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.