系统备份¶
新装了电脑,配置了一大堆东西,备份一下
有2
种方式
- 制作
ISO
文件 - 制作存档文件
制作ISO
文件¶
制作存档文件¶
参考:
最简单直接的就是root
用户执行tar
命令
$ tar -cvpzf Ubuntu-2019-01-15.tgz --one-file-system --exclude=/proc --exclude=/lost+found --exclude=/mnt --exclude=/sys --exclude=/media --exclude=./Ubuntu-2019-01-15.tgz /
参数解释
-c
:create a new archive
(创建一个新的档案文件)-v
:verbosely list files processed
(详细输出)-p
:extract information about file permissions
(default for superuser
)(提取有关文件权限的信息)-z
:filter the archive through gzip
(使用gzip
工具进行压缩)-f
:use archive file or device ARCHIVE
(结果文件名)--one-file-system
:stay in local file system when creating archive
(仅保存本地文件系统)--exclude
:exclude files, given as a PATTERN
(不备份的路径或文件,可使用正则表达式)
所以结果档案文件为Ubuntu-2019-01-15.tgz
,不存档的路径和文件包括/proc
,/lost+found
,/mnt
,/sys
,/media
,Ubuntu-2019-01-15.tgz
,存档起始路径为根目录/