Home >Operation and Maintenance >CentOS >How to backup centos system

How to backup centos system

王林
王林Original
2020-03-25 15:14:543148browse

How to backup centos system

You can use tar backup, the method is as follows:

1. Use the root user to switch to the root directory;

2. Then, use the following command Back up the complete system:

tar cvpzf backup.tgz / --exclude=/proc --exclude=/lost+found --exclude=/backup.tgz --exclude=/mnt --exclude=/sys

or

tar cvpzf /state/partition1/home/backup.tgz / --exclude=/proc --exclude=/lost+found --exclude=/backup.tgz --exclude=/mnt --exclude=/sys

Features of this method:

1. Retain permissions;

2 , suitable for backing up the entire directory;

3. You can choose different compression methods;

4. If you choose not to compress, you can also achieve incremental backup and partial restore, please refer to man tar.

Recommended tutorial: centos tutorial

The above is the detailed content of How to backup centos system. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn