The following command will backup your entire Linux system in the “ / archive /”file system, in addition to “ / proc /”camouflage file system, “ / mnt /”, “ / archive /”file system (no need to backup our backup files!), as well as Squid caching large data files (yes, in my opinion, a waste of backup media and do not need to go back up) than any mounted file system :
tar-zcvpf / archive/full-backup- `date ‘+% d-% B-% Y’`. tar.gz
- directory / – exclude = mnt – exclude = proc – exclude = var / spool / squid.
Do not be intimidated the above instructions! When we will be divided into two parts, you will find the beauty of this powerful tool.
The above command specifies the options “ z”(compress; backup data via the “ gzip”compression), “ c”(established; an archive file began to be established), “ v”(verbose ; show has a good backup of files), “ p”(to allow preservation; the protection of data will be “memory” that can be replies). “ f”(file) option, followed by his is to write the archive file (or device) name, pay attention to the file name that contains information on how to get, as long as the post with two quotes will be “ date” ring up orders. The general naming convention is the compressed file without adding “. Tar”, compressed files with “ tar.gz”“ – directory”option tells tar at the beginning of the backup before the first jump to the following file path (in this case is “/” directory). “ – exclude”options tell tar not to back up specified files or directories. Finally, “.” symbols tell tar to back up everything in the current directory.
Note: It is important to understand is that tar options are case different! In addition, most of the options can be simplified with the mnemonic numbers (that is. “ F”), or use the easier to remember the full name of the option (that is. “ file”). Ex “-” with a mnemonic character as a prefix as a recognition, in front of the full name of the prefix has two such symbols. Reference to “man” page for more information on the use of tar.
Another example, this time only write to the specified file system (and the previous one apart from all the written examples of the opposite exception) to a SCSI tape drive: tar-cvpf / dev/nst0 – label = “Backup set created on `date ‘+% d-% B-% Y’`. “- directory / – exclude = var / spool / etc home usr / local var / spool
In the above line option, pay attention not to use “ z”(compress) option. I strongly recommended against writing compressed data to tape, because if there is a part of the data tape is damaged, you will lose the entire backup!, However, are not stored in compressed archive file with high recoverability, even if the tape file there is a part of the damage.
Because the tape machine is a character device, there is no way to specify an exact file name. Therefore, the file name assigned to the tar be simplified as device name, “ / dev/nst0”, is a SCSI exchange on the first row of a tape device.
Note: “ / dev/nst0”device will not be back after doing the backup band; it is possible to write the same backup tapes several groups. (You can also choose “ / dev/st0”This device, in which case the tape in the backup will be automatically exhausted back to tape)
Since we can not specify a backup file name, “ – label”option can be written into the file itself to some of this set of backup information.
Finally, only included in the “ / etc /”, “ / home /”, “ / usr / local”, and “ / var / spool /”(apart from Squid’s cache data files) will be written into the tape.
When using tape, you can use the following command back to zone and out of the tape:
mt-f / dev/nst0 rewind
mt-f / dev/nst0 offline
Tips: You will find that when the archive file created, in front of “/” (slash) symbol will be tar removal. This is tar’s default mode of operation, which is intentionally used to protect your important files to avoid overwriting the original version, just in case you accidentally overwrite in the reconstruction process in an incorrect file.
If you really do not like this feature (remember, this is a feature!) You can specify the tar “ – absolute-paths”option, which will be retained in front of slash. However, I do not recommend doing so because it is dangerous!
The use of “ KDat”backup: If you are using the KDE desktop environment, I believe you will find “ KDat”utility is not only strong and very friendly to users. In addition, another advantage is that KDat use “ tar”as its backup engine. Thus, the backup group to write KDat can KDat not only read, can also use tar! This makes KDat become a user-friendly and backup portability in a good choice.
Tips: Even if you decide not to use nor install the full KDE package, if you have installed Qt function hall will still be able to use KDE.
When you first implement KDat, you need to create a backup profile. This profile tells KDat you want to backup system which files. If you want, you can create several backup profile, according to your needs (for example, you can create a profile called “Full Backup” to make a complete backup of the system, or “Quick Backup” only backup the user’s file).
To create a backup profile, you can choose from the menu bar “File” option to select “Create Backup Profile” (or “Backup Profiles” folder, right-click and select “Create Backup Profile”). In the right-hand side is the KDat window, you can change various settings, such as profile name, archive name, tar options, as well as others. Click the “Help” menu on the use of these settings instructions.
To specify which files should be included in your backup profile, in the “/” directory folder icon next to the check left click on the knock. This will make sure that all of the files and everything in this directory will be backed up. Then, in the folder symbol next to a small “+” knocked about on the left, the folder will be conducted to show the following files and directories. You may not want to exclude the backup files; as long as you want to exclude a file or directory for each check symbol next to knock about on the left. For example, a full backup should contain all the files have been marked and directories, it is necessary to exclude “ / proc”(a camouflaged file system, including your current operating system information ),“/ mnt”(located on the following CD-ROM directory, floppy disk drive, network share are often mounted on this), and if you are Squid users, “ / var / spool / squid”(Squid’s cache data files). Once you have selected a suitable file backups you create a good profile, click left, and then “Files>>” button on the left click on selected files will be moved into your backup profile.
Note: If your server data to so great as to not actually stored on tapes, you need to create separate backup profiles, each part of a backup group.
The actual conduct of the backup, it will put a tape from the “File” menu, select “Mount Tape” (or click with the mouse knock on the icon that looks like tape).
This will “mount” the tape (in fact, because the tape drive is a character device, in fact, can not mount it – in fact only the first KDat back belt, trying to get a reading at the beginning of information, if successful, to find the tape machine meet index. Otherwise, KDat will remind you to format the tape.
(Note: If you KDat continued to reflect the tape in the tape drive but it is not a matter of fact, you should determine the parameters specified in the tape drive name is correct, in the menu bar, click with the mouse knock on “Edit” option and then select “User Preferences” .)
Once the KDat has mounted a good tape backup before you start you must select the backup profile. When you want to start the backup, as long as the backup profile you want to knock on the Right-click, and then “Backup” knock about on the left. KDat will first display a dialog box to tell you about your choice backed up profile details; in the “Ok” on the left will begin to knock about the backup.
When the backup began, KDat will show a variety of status information of the dialog box (after time, the backup size, backup rate, estimated remaining time, file number and total number of bytes to write), and has a list of backup files. 1 gigabyte of information that contains several full backup may take several hours. If necessary, during the backup process at any time you can “Abort” button on the left knocking about to give up the backup.
Once the backup is complete, you can select the menu bar “Edit”, then select “Unmount Tape” to alleviate the mounting tape, or tape icon knocked about, so that the tape will be back to take and then jump out.
Undoubtedly, the ratio of line backup more important things is that when the problem occurred after the resumption of the normal give important files!