今天要把数据库的内容进行打包,就在这时出现了报错,不慌来看看
1、错误提示:
-bash: /bin/tar: Argument list too long
#大概意思是:您打包的内容太长了,我们处理不了
2、问题分析:
1,目录中文件数量过大
2,系统支持打开的文件数过小
3、解决方法:
find . -name ‘*.txt‘ -print >/tmp/test.manifest
tar -cvzf textfiles.tar.gz --files-from /tmp/test.manifest
4、事件过程
[[email protected] home]# find . -name "*.log" -print >/tmp/qyt.txt
[[email protected] home]# cat /tmp/qyt.txt ##收集要打包文件,并列表
./wwwlogs/nginx_error.log
./wwwlogs/access.log
./qiuyuetao/logs/nginx_error.log
./qiuyuetao/logs/access.log
./1.log
./2.log
./3.log
./list.log
[[email protected] home]# tar -zcvf test.tar.gz --files-from /tmp/qyt.txt #打包
./wwwlogs/nginx_error.log
./wwwlogs/access.log
./qiuyuetao/logs/nginx_error.log
./qiuyuetao/logs/access.log
./1.log
./2.log
./3.log
./list.log
[[email protected] home]# tar -tf test.tar.gz ##查看打包内容
./wwwlogs/nginx_error.log
./wwwlogs/access.log
./qiuyuetao/logs/nginx_error.log
./qiuyuetao/logs/access.log
./1.log
./2.log
./3.log
./list.log
原文地址:http://blog.51cto.com/qiuyt/2087709
时间: 2024-10-02 10:15:19