Tar大量數據打包-bash: /bin/tar: Argument list too long
阿新 • • 發佈:2018-03-16
tar too long tar打包 逗哥自動化 今天要把數據庫的內容進行打包,就在這時出現了報錯,不慌來看看
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、事件過程
[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