kri*_*fur 22 linux command-line tar
我尝试使用ssh在chroot环境中使用tar压缩tar,但它失败了,因为它只是压缩符号链接本身,我如何压缩它的内容?
-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
Run Code Online (Sandbox Code Playgroud)
谢谢
Ign*_*ams 27
从tar(1)手册页:
Run Code Online (Sandbox Code Playgroud)-h, --dereference follow symlinks; archive and dump the files they point to
Mar*_*bad 19
注意将"h"选项放在正确的位置.在你的例子中:
tar -cjvf archive.tar.bz2 mainwebsite_html
Run Code Online (Sandbox Code Playgroud)
应该
tar -chjvf archive.tar.bz2 mainwebsite_html
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
20031 次 |
| 最近记录: |