(Linux Study Notes 1: Compressed) [20180209], Study Notes 20180209
Study Note 1: compress the file extension by compressing the command at a.m. on April 9, February 5, 2015 *. tar, * .tar.gz ,*. tgz ,*. gz ,*. Z ,*. bz2 common compression commands gzip and bzip2, bzip2 compression ratio gzip is better tar can be used for file packaging, and supports gzip and bzip2 compressed tar-jvc-f filename.tar.bz2/directory query tar-jtv-f filename.tar.bz2 decompress tar-jxv-f unzip-C/puorose/directoryDump command to back up if the backup of a file system or a single directory Dump is for a file system, 0 ~ 9 level Differential backup. The level 0 indicates the complete Backup restore command to restore the backup file created by dump. When you want to create a new disc to burn data, you can use the mkisofs command to build a complete partition or disk that can be backed up by writing CD or DVD recorder dd through cdrecord, because dd can read the surface data of the hard disk sector, cpio is an excellent BACKUP command, however, you must use the find command to read the prepared files. Test the drill. gzip and bzip2 compressed tar are packaged in the gzip compression format and the log and bz compressed files are excluded. [oracle @ xitest01 schema] $ tar- zcv-f schema_tar_test.tar.gz -- exclude =/u03/schema /*. log -- exclude =/u03/schema /*. bz/u03/schema uses the bzip2 compression format and exclude log and gz Compression Files [oracle @ xitest01 schema] $ tar-jcv-f schema_tar _ Test.tar.bz2 -- exclude =/u03/schema /*. log -- exclude =/u03/schema /*. gz/u03/schema to view the compression ratio [oracle @ xitest01 schema] $ du-sh schema_tar_test.tar. * 160 K schema_tar_test.tar.bz2260K dig backup file system simulate a file drive letter [root @ xitest01 u04] # dd if =/dev/zero of =/u04/loop_mount bs = 1 M count = 10241024 + 0 records in1024 + 0 records outparts 3741824 bytes (1.1 GB) copied, 8.35942 seconds, 128 MB/s [root @ xitest01 u04] # Mkfs. ext3/u04/loop_mount [root @ xitest01 u04] # mount-o loop/u04/loop_mount/u04/mount_loop [root @ xitest01 u04] # df-hFilesystem Size Used Avail Use % Mounted on/dev/sda2 9.7G 5.4G 3.9G 59% // dev/sda6 31G 1.9G 28G 7%/u02/dev/sda5 30G 21G 7.1G 75%/u01/ dev/sda1 190 M 23 M 158 M 13%/boottmpfs 1005 M 0 1005 M 0%/dev/shm/dev/sdb 504G 263G 216G 55%/u03/dev/sdc1 504G 312G 167G 66%/u04/u04/loop_mount 1008 M 34 M 924 M 4%/u04/mount_loop create the dump backup Directory [root @ xitest01 u04] # mkdir backup [root @ xitest01 u04] # dump-0-j-f/u04/ backup/dump. bak/u04/loop_mount DUMP: Dumping/dev/sdc1 (/u04 (dir/loop_mount) to/u04/backup/dump. bak DUMP: Label: none DUMP: Writing 10 Kilobyte records DUMP: Compressing output at compression level 2 (bzlib) DUMP: mapping (Pass I) [regular files] DUMP: mapping (Pass II) [directories] DUMP: estimated 1067027 blocks. DUMP: Volume 1 started with block 1 at: Thu Feb 5 10:08:25 2015 DUMP: dumping (Pass III) [directories] DUMP: dumping (Pass IV) [regular files] DUMP: closing/u04/backup/dump. bak DUMP: Volume 1 completed at: Thu Feb 5 10:09:01 2015 DUMP: Volume 1 took 0:00:36 DUMP: Volume 1 transfer rate: 156 kB/s DUMP: Volume 1 limit 7020kb uncompressed, 5627kB compressed, 189.626: 1 DUMP: 1067020 blocks (1042.01 MB) on 1 volume (s) DUMP: finished in 36 seconds, throughput 29639 kBytes/sec DUMP: Date of this level 0 dump: thu Feb 5 10:08:25 2015 DUMP: Date this dump completed: Thu Feb 5 10:09:01 2015 DUMP: Average transfer rate: 156 kB/s DUMP: Wrote limit 7020kb uncompressed, 5627kB compressed, 189.626: 1 DUMP: dump is done [root @ xitest01 u04] # ls-l/u04/backup/total 5640-rw-r -- r -- 1 root 5762814 Feb 5 10:09 dump. bak [root @ xitest01 u04] # du-sh/u04/backup/5.6 M/u04/backup/test adding files to the directory [root @ xitest01 u04] # cp ogg.tar.gz/u04/ mount_loop/[root @ xitest01 u04] # du-sh/u04/mount_loop/503 M/u04/mount_loop/[root @ xitest01 u04] # dump-1-j-f/u04 /backup/dump. bak/u04/loop_mountDUMP: Only level 0 dumps are allowed on a subdirectory (not a single file system) DUMP: The ENTIRE dump is aborted. backup boot drive letter Test [root @ xitest01 u04] # dump-0-j-f/u04/backup/dump_boot.bak/dev/sda1 [root @ xitest01 u04] # dump-1-j-f/ u04/backup/dump_boo01.bak/dev/sda1 DUMP: WARNING: There is no inferior level dump on this filesystem DUMP: WARNING: Assuming a level 0 dump by default (does the boot Directory have no difference in backup ?) [Root @ xitest01 u04] # cd/u04/backup/[root @ xitest01 backup] # lsdump. bak dump_boo01.bak dump_boot.bak [root @ xitest01 backup] # du-sh * 5.6 M dump. bak16M dump_boo01.bak16M dump_boot.bak
Database |
Ip |
Gzip |
|
Bzip2 |
|
Xxxxx |
Xxx. xxx |
10:22:00 ~ 01: 5600 3 hours |
16 GB |
~ |
9.2 GB |