-bash: /bin/tar: Argument list too long
#大概意思是:您打包的内容太长了,我们处理不了
1,目录中文件数量过大
2,系统支持打开的文件数过小
find . -name ‘*.txt‘ -print >/tmp/test.manifest
tar -cvzf textfiles.tar.gz --files-from /tmp/test.manifest
[root@localhost home]# find . -name "*.log" -print >/tmp/qyt.txt
[root@localhost 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
[root@localhost 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
[root@localhost 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
Tar大量数据打包-bash: /bin/tar: Argument list too long
原文地址:http://blog.51cto.com/qiuyt/2087709