Solaris中的Gtar,根据大小

时间:2017-11-16 12:44:41

标签: unix tar solaris-10

我正在使用一个gtar命令,它应该在pendrive中创建10 GB的文件。我研究了一点,并且知道FAT 32文件系统支持最大4gb的文件。如何通过基于小于4gb的文件大小进行拆分来检查创建多个文件的运行gtar命令的中间位置。

Gtar应该能够检测到它创建的文件是否超过4 GB大小,然后它应该停止创建该文件并继续创建另一个文件。

我知道我们可以在一个位置制作10 GB文件并拆分该静态文件,但我们不希望这样。

2 个答案:

答案 0 :(得分:0)

您可以像这样使用split命令:

cd /path/to/flash
tar cvf - /path/of/source/files |split -b 4198400

答案 1 :(得分:-1)

查看手册页以获取这些选项。

[--tape-length=NUMBER] [--multi-volume] 


Device selection and switching:
-f, --file=ARCHIVE
use archive file or device ARCHIVE
--force-local
archive file is local even if it has a colon
-F, --info-script=NAME, --new-volume-script=NAME
run script at end of each tape (implies -M)
-L, --tape-length=NUMBER
change tape after writing NUMBER x 1024 bytes
-M, --multi-volume
create/list/extract multi-volume archive
--rmt-command=COMMAND
use given rmt COMMAND instead of rmt
--rsh-command=COMMAND
use remote COMMAND instead of rsh
--volno-file=FILE
use/update the volume number in FILE
Device blocking:
-b, --blocking-factor=BLOCKS

BLOCKS x 512 bytes per record
-B, --read-full-records
reblock as we read (for 4.2BSD pipes)
-i, --ignore-zeros
ignore zeroed blocks in archive (means EOF)
--record-size=NUMBER
NUMBER of bytes per record, multiple of 512