使用 tar,我尝试使用 ssh 在 chroot 环境中压缩存储库,但失败了,因为它只是压缩了符号链接(symbolic link)本身。
如何压缩其内容?
-bash-3.00$ ls -ail
1263583 lrwxrwxrwx 1 root root 18 Apr 18 2008 mainwebsite_html -> ../../var/www/html
-bash-3.00$ tar -cjvf archive.tar.bz2 mainwebsite_html
-bash-3.00$ ls -ail
7509101 -rw-r--r-- 1 user1 user1 136 Feb 22 08:57 archive.tar.bz2
1263583 lrwxrwxrwx 1 root root 18 Apr 18 2008 mainwebsite_html -> ../../var/www/html
最佳答案
来自 tar(1)
手册页:
-h, --dereference follow symlinks; archive and dump the files they point to
关于linux - 如何压缩符号链接(symbolic link)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5076181/