Comparison and operation examples of four Linux backup tools

Source: Internet
Author: User
Standard UNIX systems provide basic backup tools. Different backup tools are different. Dump, cpio, tar, dd, dump, and restore are usually the best choices. The second is cpio, but it is less friendly than tar; tar is easier to use than dump or cpio. If you want to use tar or cpio to back up rawdevices or perform remote backup, then dd

Standard UNIX systems provide basic backup tools. Different backup tools are different.DuMp,CpIo, tar andDd,DumpAndRestoreIt is usually the best choice. SecondCpioBut it is less friendly than tar. tar is easier to use than dump or cpio. If you want to use tar or cpio to back up raw devices or perform remote backup, dd is another option.

Dump

Dump can back up a directory or entire file system to a specified device, or back up a large file. Dump can execute functions similar to tar. However, dump tends to consider file systems rather than individual files. The following content is taken from the dump manual file: "dump checkExT2 file system, and determine which files need to be backed up. These files will be copied to a given disk, tape, or other storage media for security protection. Dump larger than the output media capacity will be divided into multiple volumes. In most media, the capacity is always written until an end-of-m is returned.EdThe ia flag is used to determine ."

The program that works with dump is restore, which is used to restore files from the dump image.

RestoreCommandExecute the reverse function of the dump. You can restore the full backup of the file system first, and the subsequent Incremental Backup can overwrite the restored full backup. Individual files or directory trees can be restored from full or partial backups.

Dump and restore can both run on the network. Therefore, you can back up or restore data from a remote device. Dump and restore use tape drives and file devices that provide a wide range of options. However, both are only applicable to ext2 and ext3 file systems. If you are using JFS, Reiser, or other file systems, you will need other utilities, such as tar.

Cpio

If no dump command is required or the dump version does not match, cpio is your next good choice. Cpio is longer than other backup tools, and has some important features that other tools lack. However, it should be noted that some functions are provided by dump but cpio is not, as follows:

◆ No need to useTouchOrFindFile to perform the change backup (INcRemental backup );

◆ A that does not change data after backupTimeAnd ctime;

◆ Perform data recovery in interactive mode, such as restore option-I.

Cpio is a very useful backup tool. Its biggest difference is that it can back up files from standard input (stdin. Currently, some new versions of tar support archive backup from standard input, but most of them do not yet have this feature.

Why is cpio rarely used?

If cpio is so useful, why is tar popular? The most likely reason is the same function. tar is easier to use than cpio (standard ). For example, each version of tar supports tar cf device and tar xf device, while cpio sometimes supports I and O, and some versions do not. If you accumulate options for each cpio version, there are nearly 40 options, and some parameters that use the same letter have different meanings in different versions of Unix. However, as long as you use standard options on most platforms, cpio and tar are almost easy to use.

Tar

If you need to regularly back up the entire job system, dump may be the best choice. The second is cpio, because it can be used with find to execute an incremental backup ). If you, like most people, only make a full backup of the data, you do not need to regularly or change the backup and other functions. For example, you may want to quickly back up the user/home directory. You may want to delete a large group of directories and files from a user, but the only backup method that can be accepted by the user is to write all the data into the tape or disc for storage and hand it over to him. Therefore, you do not care about atime and do not need to regularly make changes to the backup. You only want to put a pile of data on the backup media, and also hope that others can easily extract the data from the backup, in this case, tar is the best choice.

Some functions are available in cpio, while most tar does not (GNU tar does not have these restrictions). For example:

◆ You can back up files from stdin;

◆ Reset the atime of the archive when the backup is complete, although this will change its ctime.

Although the history of tar is not longer than that of cpio, It is very popular, which is one of its characteristics. Almost everyone knows how to read the tar file, even if it is not easy to learn. Some programs, such as WinZip, can even automatically unlock a tar file orCompressionTo read the content of a tar file (the cpio file cannot be enabled in WinZip ). Tar is also more reliable than dump or cpio on Unix platforms.

Dd

Most people do not often use dd for backup. It is a very low-level command that can move every bit of information from one place to another without moving, it does not need to know the structure of the backup data either. Therefore, unlike dump, tar, and cpio, it cannot copy a group of files to a storage media, but can only copy one file or part of one file, partition, or part of partition, you can even copy the data from the standard input (stdin) to the standard output (stdout) during the data modification process ). Even if dd can copy a single file, it knows nothing about the file name or content. It simply transfers the file metadata from one place to another.

Dd is a file system replication utility that generates binary copies of the file system. Dd can also be used to generate images of hard drive, similar to products such as Symantec's Ghost. However, dd is not file-based, so you can only use it to restore data to the same hard drive partition.

This method seems quite simple, relatively elastic, and can be copied without considering the data format. Therefore, it can be used for data conversion on two different platforms. For example, from EBCDIC to ASCII, or Oracle allows data to exist as files in the file system, or directly store data in the original disk block, however, the backup program cannot predict how the Administrator will store the data. Therefore, the flexible dd is used for automatic backup, and even the backup results are mixed with the two data forms, that is, some are in the file system, and some are on the original disk. In this way, the Administrator determines the storage mode based on the data application characteristics. It can be seen that the elasticity benefits provided by dd are great.

Other backup tools

There are other backup tools that are not well-known or only available on some platforms, including:

◆ Cp command: cp is short for copy. It is used to copy files and directories. The standard cp command can be used to copy the entire directory tree. This option performs unknown operations on non-standard files. Some UNIX variants and GNU cp tools support the-R option, which allows you to correctly copy named pipelines, links, and other files.

◆ Pax: pax is the abbreviation of Portable Archive eXchange and can generate a Portable backup. The backup format complies with the Archive/Interchange File Fo of IEEE Std.1003.1-1988.RmAt. Pax can also read and write some other file formats, such as tar or cpio. Like many phenomena in the Unix world, pax also has a group of advocates who think it is the best choice for backup tools.

◆ Fbackup: fbackup is only provided by the HP-UX and belongs to the HP System AdminisTrOne of the tools of ation Menu (SAM), backed up with fbackup, can only be read on another HP-UX host using frecover. Although fbackup has more functions than traditional tar and cpio, its lack of portability is very criticized. Even if you cannot use SAM to operate dump, cpio, or tar, the portable features of these three commands are definitely worth a lot of effort to use them.

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.