Linux-copy between hosts keeps the symbolic link unchanged

Source: Internet
Author: User
Linux-copy between hosts keeps the symbolic link unchanged-Linux Enterprise Application-Linux server application information. For details, refer to the following section. Author: pcwlno1

Assume that there are two Linux Hosts, A and B. The IP addresses are 192.168.1.40 and 192.168.1.50 respectively. Now we need to copy the directory yyy (which has A symbolic link) on/home/xxx/to/home/xxx/on B:

Method 1: On:

Cd/home/xxx
Tar-cvf yyy.tar./yyy

If yyy.tar is large, use the command again.

Gzip yyy.tarto yyy.tar.gz for compression. Copy yyy.tarw.yyy.tar.gz to the/home/xxx/directory of host B, and run tar-xvf yyy.tar or tar-zxvf yyy.tar.gz. Remember to decompress the command. Otherwise, the symbolic link is lost.

Method 2: Activate the NFS service for/home/xxx/yyy on.

Perform the following operations on B:

Mount-t nfs-o nolock 192.168.1.40:/home/xxx/yyy/mnt
Cd/home/xxx
Mkdir yyy
Cp-a/mnt/*/home/xxx/yyy

Finally, umount/mnt.
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.