解决打包软链接打包失败问题
一般情况下打包文件时,如果直接打包软连接会导致打包失败,即没有将要打包的内容打包进去,这里提供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打包软连接实际目录下内容操作成功
转载于:https://blog.51cto.com/ucode/1763056
解决打包软链接打包失败问题相关推荐
- mysql文件软连接失败,解决打包软链接打包失败问题
一般情况下打包文件时,如果直接打包软连接会导致打包失败,即没有将要打包的内容打包进去,这里提供tar打包参数-h [root@localhost ~]# ll /etc/rc.local lrwxrw ...
- android应用是非正式版本,Androidstudio 打包apk安装失败 应用是非正式发布版本,当前设备不支持安装...
Androidstudio 打包apk安装失败 应用是非正式发布版本,当前设备不支持安装 环境:Androidstudio 4.0 华为手机版本 10.0 android { compileSdkV ...
- 打包后index.html路径错误,解决Vue项目打包后打开index.html页面显示空白以及图片路径错误的问题...
解决Vue项目打包后打开index.html页面显示空白以及图片路径错误的问题 2018年05月23日 10:05:35 for_weber 阅读数:14179 Vue项目运行npm run buil ...
- 如何解决使用webpack打包之后,font-awsome路径不对的问题,终极解决方法
如何解决使用webpack打包之后,font-awsome路径不对的问题,终极解决方法 参考文章: (1)如何解决使用webpack打包之后,font-awsome路径不对的问题,终极解决方法 (2) ...
- 解决spring-boot-maven-plugin插件打包,springboot启动时报找不到主main问题
解决spring-boot-maven-plugin插件打包,springboot启动时报找不到主main问题 参考文章: (1)解决spring-boot-maven-plugin插件打包,spri ...
- 解决spring coud打包报Singleton bean creation not allowed while singletons of this factory are in destruct
解决spring coud打包报Singleton bean creation not allowed while singletons of this factory are in destruct ...
- 快速解决Vue项目打包后文件过大问题
快速解决Vue项目打包后文件过大问题 为什么打包后文件过大? 如何快速解决 一.路由懒加载[使用es6提案的import()方式] 二.CDN引入 为什么打包后文件过大? 移动app项目,使用vue- ...
- alive的不生效 keep vue_vue解决使用webpack打包后keep-alive不生效的方法
问题是这样的,我使用webpack的npm run dev运行的时候,keep-alive路由缓存是有效的,但是我npm run build,把文件放到实际的项目中去的时候,会有如下的问题: 路由如下 ...
- 已解决paddleocr infer_rec打包framework_pb2,导包import framework_pb2 as framework__pb2报错
已解决paddleocr infer_rec打包framework_pb2,导包import framework_pb2 as framework__pb2 ,抛出异常import framework ...
最新文章
- 在SQL Server中保存和输出任意类型的文件
- QGLViewer编译过程
- matlab中if语句多个_科学计算 | MATLAB程序设计基础
- vs.net 打开.xaml文件编辑界面_怎么保护可移动磁盘中的文件防止被删除
- 露天影院网站_为什么要在露天工作?
- meta标签以及一些基本标签
- 文档服务器archive,文档查询服务器,archive server,音标,读音,翻译,英文例句,英语词典...
- jboss下载及安装
- IDEA崩溃:A fatal error has been detected by the Java Runtime Environment解决方案
- 差异性分析该如何选择?
- Qt开发QtQuick程序在编译时报错:0x00007FFE4E60BB6B (ig9icd64.dll) 处有未经处理的异常: 0xC0000005: 读取位置 0xFFFFFFFFFFFFF
- [编程题] 翻转数列--附详细分析思路
- antd upload取消图片删除按钮
- AD7616的国产替代方案—ADCS16162(16位16通道同步采样ADC)
- jango model.obejcts.filter 查询指定字段
- ASP空间设置不同域名到不同目录的方法
- Android 手写字体识别
- Linux课程报告总结
- t420i升级固态硬盘提升_科赋CRAS C710 M.2固态硬盘评测:经典再升级
- 2020年电工(中级)实操考试视频及电工(中级)操作证考试