Linux-volume splitting compression and decompression
Linux-volume splitting compression and decompression
1. First compress the Directory into a file
Root @ bkjia # tar zcvf apk.tar apk/
2. Split the file. The file suffix after the split is: Number partition (for example, apk_2015.tar01,apk_2015.tar 02).-B specifies the size of the split file, followed by the file to be split, and the storage path and name prefix of the split file.
Root @ bkjia # split-d-B 30000 m apk.tar ../apk_2015.tar
3. Effect of split files
Root @ bkjia-172-31-6-97:/dump # ll
Total 586332520
Drwxr-xr-x 4 uusafe 4096 Oct 25 ./
Drwxr-xr-x 27 root 4096 Oct 23 ../
-Rw-r -- 1 root 31457280000 Oct 25 14:19 apk_2015.tar00
-Rw-r -- 1 root 31457280000 Oct 25 14:30 apk_2015.tar01
-Rw-r -- 1 root 31457280000 Oct 25 14:41 apk_2015.tar02
-Rw-r -- 1 root 31457280000 Oct 25 14:51 apk_2015.tar03
-Rw-r -- 1 root 31457280000 Oct 25 :02 apk_2015.tar04
-Rw-r -- 1 root 31457280000 Oct 25 15:13 apk_2015.tar05
-Rw-r -- 1 root 31457280000 Oct 25 :23 apk_2015.tar06
-Rw-r -- 1 root 31457280000 Oct 25 :34 apk_2015.tar07
-Rw-r -- 1 root 31457280000 Oct 25 :45 apk_2015.tar08
-Rw-r -- 1 root 31457280000 Oct 25 :55 apk_2015.tar09
-Rw-r -- 1 root 31457280000 Oct 25 16:06 apk_2015.tar10
-Rw-r -- 1 root 14004787200 Oct 25 16:11 apk_2015.tar11
4. Restore
The following jx parameter description:
X: Extract
J: Specifies the zip file in the extract mode. This is because the zip file is used for compression.
Root @ bkjia # cat apk_2015.tar * | tar-jx
This article permanently updates the link address: