mysql文件软连接失败,解决打包软链接打包失败问题
一般情況下打包文件時,如果直接打包軟連接會導致打包失敗,即沒有將要打包的內容打包進去,這里提供tar打包參數-h
[root@localhost ~]# ll /etc/rc.local
lrwxrwxrwx. 1 root root 13 Nov 24 00:45 /etc/rc.local -> rc.d/rc.local
[root@localhost ~]# tar czf tar.gz /etc/rc.local
tar: Removing leading `/' from member names
[root@localhost ~]# ll
[root@localhost ~]# sz tar.gz
rz
Starting zmodem transfer. ?Press Ctrl+C to cancel.
100% ? ? 117 bytes ?117 bytes/s 00:00:01 ? ? ? 0 Errors
[root@localhost ~]#
發現打包結果并沒有將/etc/rc.local下的內容打包進來
所以這里用-h參數
[root@localhost ~]# tar czfh rc.local.tar.gz /etc/rc.local
tar: Removing leading `/' from member names
[root@localhost ~]# ll
total 84
-rw-------. 1 root root ?1508 Nov 24 00:48 anaconda-ks.cfg
drwxr-xr-x. 5 root root ?4096 Jun 10 ?2015 fabric-scripts
-rw-r--r--. 1 root root 17062 Dec 28 10:03 fabric-scripts.tar.gz
-rw-r--r--. 1 root root 33502 Nov 24 00:48 install.log
drwxr-xr-x. 2 root root ?4096 Apr ?7 15:08 logs
drwxr-xr-x. 3 root root ?4096 Mar 23 10:35 mysql-sql
-rw-r--r--. 1 root root ? 415 Apr 12 16:42 rc.local.tar.gz
-rw-r--r--. 1 root root ? 117 Apr 12 16:31 tar.gz
[root@localhost ~]# sz rc.local.tar.gz
rz
Starting zmodem transfer. ?Press Ctrl+C to cancel.
100% ? ? 415 bytes ?415 bytes/s 00:00:01 ? ? ? 0 Errors
[root@localhost ~]#
[root@localhost ~]# tar xf rc.local.tar.gz
[root@localhost ~]# ll
-rw-r--r--. 1 root root ? 415 Apr 12 16:42 rc.local.tar.gz
-rw-r--r--. 1 root root ? 117 Apr 12 16:31 tar.gz
[root@localhost ~]# cd etc/
[root@localhost etc]# ll
total 4
-rwxr-xr-x. 1 root root 420 Mar ?8 14:36 rc.local
[root@localhost etc]# cat rc.local
#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.
touch /var/lock/subsys/local
#startup Open*** on boot
/usr/local/sbin/open*** --config /etc/open***/product.server.conf &
#add a iptables ruler
/sbin/iptables -t nat -I POSTROUTING -s 10.8.0.0/255.255.255.0 -o eth0 -j MASQUERADE
[root@localhost etc]#
至此,用tar打包軟連接實際目錄下內容操作成功
總結
以上是生活随笔為你收集整理的mysql文件软连接失败,解决打包软链接打包失败问题的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 隐形眼镜日抛多少钱啊?
- 下一篇: 外贸盒子在哪设置安装第三方软件