- 论坛徽章:
- 0
|
小小总结一下:
1、关于-F参数的用法,SCO和LINUX是有区别的;
sco系统的解释:
- F Causes tar to use the next argument as the name of a file from which
- succeeding arguments are taken.
复制代码
LINUX的用法不太清楚,好像是自动执行的脚本,我这里没有环境,无法测试。
2、关于xargs传递参数的问题:
- cat /tmp/test.list |xargs tar cvf /tmp/upload.tar
复制代码
在文件较少的情况下没有问题,但是如果文件很多,xargs将自动根据需要分批执行(保证不会出现参数溢出的情况),即lz提到的
“只有列表后半部约591个文件”,其实只是最后一批执行的结果覆盖了前面生成的文件而已,而且只要文件存在就不会报错,所以
正确的用法是用u代替c,表示用追加而不是覆盖的方式生成tar包。
- c Creates a new archive; writing begins at the beginning of the
- archive, instead of after the last file.
- u The named files are added to the archive if they are not already
- there, or if they have been modified since last written on that
- archive. This function letter cannot be used with tape devices.
复制代码
[ 本帖最后由 ruifox 于 2009-3-11 08:02 编辑 ] |
|