藍森林首頁 | 返回主頁 | 本站地圖 | 站內搜索 | 聯繫信箱 |
 您目前的位置:首頁 > 自由軟件 > 技術交流 > 應用編程


    

藍森林 http://www.lslnet.com 2006年6月26日 11:18


請教該如何通過shell來這樣tar

把當前目錄下的所有文件(包含子目錄下的文件),tar 成一個個tar 包,每個tar包不能超過2G
假設文件大小和路徑已經列出:
size   file
123    home/11/234123.txt
222   home/22/234234.txt
123   home/233/sdfs.txt
4456 home/233/sdd.txt
888   home/234/asdf.txt
.......................................
......................................

請教該如何實現當size一列累加到2000時,自動繼續tar另外一個tar包,另每個tar包不大於2g

man tar

k選項

tar 有k選項?

姑妄言之

sco506:
man tar:

................

  k       Causes tar to use the next argument as the size of an archive volume
          in kilobytes (KB). The minimum value allowed is 250. Very large
          files are split into ``extents'' across volumes. When restoring
          from a multi-volume archive, tar only prompts for a new volume if a
          split file has been partially restored. To override the archive
          length value in the default file, specify 0 as the argument to k on
          the command line.


................

hpux 上 tar沒這選項:(



Copyright © 1999-2000 LSLNET.COM. All rights reserved. 藍森林網站 版權所有。 E-mail : webmaster@lslnet.com