comprime file di dimensioni lunghe in file xz di dimensioni multiple

1

Ho file di dimensioni da 28 GB.

Voglio comprimere usando .xz LZMA , con file .xz di file di dimensioni 1G (1024MB) .. .

MyFile.vdi -> MyFile00.xz, MyFile01.xz, MyFile02.xz...

Come farlo in macOS ?

Modifica

sh-3.2# xz -ek9vfc Centos\ 7\ 1511\ 64bits_20170629\(with_dukto\).vdi
xz: Compressed data cannot be written to a terminal
xz: Try 'xz --help' for more information.
sh-3.2# 

SECOND EDIT

con

# xz -ek9vfc Centos\ 7\ 1511\ 64bits_20170629\(with_dukto\).vdi

# xz -e9vfc < Centos\ 7\ 1511\ 64bits_20170629\(with_dukto\).vdi | split -b 1024m - Centos\ 7\ 1511\ 64bits_20170629\(with_dukto\).vdi.xz

Ecco l'output.

# ls -al Centos\ 7\ 1511\ 64bits_20170629\(with_dukto\).vdi*
-rw-------@ 1 _unknown  _unknown  17470324736 Jun 29 23:47 Centos 7 1511 64bits_20170629(with_dukto).vdi
-rw-r--r--  1 _unknown  _unknown   3898588580 Aug 22 22:19 Centos 7 1511 64bits_20170629(with_dukto).vdi.xz
-rw-r--r--  1 _unknown  _unknown   1073741824 Aug 23 12:15 Centos 7 1511 64bits_20170629(with_dukto).vdi.xzaa
-rw-r--r--  1 _unknown  _unknown   1073741824 Aug 23 13:44 Centos 7 1511 64bits_20170629(with_dukto).vdi.xzab
-rw-r--r--  1 _unknown  _unknown   1073741824 Aug 23 18:17 Centos 7 1511 64bits_20170629(with_dukto).vdi.xzac
-rw-r--r--  1 _unknown  _unknown    677363108 Aug 23 21:44 Centos 7 1511 64bits_20170629(with_dukto).vdi.xzad
sh-3.2# 

Ecco l'aiuto

# xz -h
Usage: xz [OPTION]... [FILE]...
Compress or decompress FILEs in the .xz format.

  -z, --compress      force compression
  -d, --decompress    force decompression
  -t, --test          test compressed file integrity
  -l, --list          list information about .xz files
  -k, --keep          keep (don't delete) input files
  -f, --force         force overwrite of output file and (de)compress links
  -c, --stdout        write to standard output and don't delete input files
  -0 ... -9           compression preset; default is 6; take compressor *and*
                      decompressor memory usage into account before using 7-9!
  -e, --extreme       try to improve compression ratio by using more CPU time;
                      does not affect decompressor memory requirements
  -T, --threads=NUM   use at most NUM threads; the default is 1; set to 0
                      to use as many threads as there are processor cores
  -q, --quiet         suppress warnings; specify twice to suppress errors too
  -v, --verbose       be verbose; specify twice for even more verbose
  -h, --help          display this short help and exit
  -H, --long-help     display the long help (lists also the advanced options)
  -V, --version       display the version number and exit

With no FILE, or when FILE is -, read standard input.

Report bugs to <[email protected]> (in English or Finnish).
XZ Utils home page: <http://tukaani.org/xz/>
sh-3.2# 
    
posta Chepe Questn 16.08.2017 - 20:33
fonte

2 risposte

1

Utilizza split .

Esempio: xz -e9vfc < yourFile.vdi | split -b 1024m - yourFile.vdi.xz.

Questo dividerà il tuo File.vdi in blocchi compressi da 1 GB, con suffisso aa-zz.

Per riassemblare, fai cat yourFile.vdi.xz.* > yourFile.xz

7-zip è PIÙ capace, ma meno onnipresente. Dovrai eseguire il checksum dei tuoi backup e verificarlo di tanto in tanto. Dai un'occhiata a un pacchetto GUI di p7zip. Ti permetterà di selezionare i livelli di compressione e le dimensioni del volume di 1 GB ... Se stai facendo questo in un batchjob non presidiato, p7zip è più sporco. Posso trovare uno dei miei snippet se ne hai bisogno.

Una cosa carina di xz è che puoi assegnare n core a un lavoro. Credo che sia il -T flag. Ricordati di nice a 20 se intendi usare quel mac per qualcosa di diverso da un grosso fermacarte se usi tutti i core contemporaneamente.

    
risposta data 18.08.2017 - 13:37
fonte
-2

Se si tratta di un file di testo, è possibile utilizzare il comando terminal split per dividere il file iniziale in file più piccoli e quindi comprimerli tutti in un file batch. La pagina man su split ti dirà come determinare la dimensione dei file più piccoli. Il comando split creerà tutti i file di output necessari in base alla grandezza con cui gli hai detto di rendere ogni file. L'uso della compressione in batch rende questo tempo piuttosto efficiente.

    
risposta data 16.08.2017 - 22:17
fonte

Leggi altre domande sui tag