Linux

关注公众号 jb51net

关闭
首页 > 网站技巧 > 服务器 > Linux > Linux操作系统下dump命令

Linux操作系统下dump命令的使用及说明

作者:lisanmengmeng

dump命令在Linux操作系统中用于备份文件系统,支持全量和增量备份,可以将数据备份到多种存储介质

Linux操作系统下dump命令

在 Linux 操作系统中,dump 命令是一个用于备份文件系统的工具,特别适用于 ext2、ext3 和 ext4 文件系统。

它可以执行全量备份和增量备份,并能够将数据备份到磁带、硬盘或其他存储介质

dump 命令简介

主要功能

基本语法

bash

dump [options] filesystem

常用选项

命令安装部署

root@rke2-24:~# which dump
root@rke2-24:~# dump
Command 'dump' not found, but can be installed with:
apt install dump
root@rke2-24:~# apt install dump
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following NEW packages will be installed:
dump
0 upgraded, 1 newly installed, 0 to remove and 14 not upgraded.
Need to get 130 kB of archives.
After this operation, 372 kB of additional disk space will be used.
Get:1 http://mirrors.aliyun.com/ubuntu focal/universe amd64 dump amd64 0.4b46-6 [130 kB]
Fetched 130 kB in 0s (508 kB/s)
Selecting previously unselected package dump.
(Reading database ... 74179 files and directories currently installed.)
Preparing to unpack .../dump_0.4b46-6_amd64.deb ...
Unpacking dump (0.4b46-6) ...
Setting up dump (0.4b46-6) ...
update-alternatives: using /usr/sbin/rmt-dump to provide /usr/sbin/rmt (rmt) in auto mode
Processing triggers for man-db (2.10.2-1) ...
Scanning processes...
Scanning linux images...

Running kernel seems to be up-to-date.

No services need to be restarted.

No containers need to be restarted.

No user sessions are running outdated binaries.

No VM guests are running outdated hypervisor (qemu) binaries on this host.
root@rke2-24:~# dump --help
dump: invalid option -- '-'
dump 0.4b46 (using libext2fs 1.46.5 of 30-Dec-2021)
usage: dump [-level#] [-acmMnqSuv] [-A file] [-B records] [-b blocksize]
[-d density] [-D file] [-e inode#,inode#,...] [-E file]
[-f file] [-h level] [-I nr errors] [-j zlevel] [-Q file]
[-s feet] [-T date] [-y] [-z zlevel] filesystem
dump [-W | -w]

使用案例

1)使用以下命令查看哪些文件系统需要进行备份

2)执行全量备份

要对 /home 文件系统执行全量备份并将其写入到 /dev/sdb1(假设这是一个磁带设备),可以使用以下命令:

dump -0f /dev/sdb1 /home

把home 目录备份到root 文件夹下

dump -0f /root/home_file /home

总结

以上为个人经验,希望能给大家一个参考,也希望大家多多支持脚本之家。

您可能感兴趣的文章:
阅读全文