24 Linux高级篇-备份与恢复
24 Linux高级篇-备份与恢复
文章目录
- 24 Linux高级篇-备份与恢复
- 24.1 安装dump和restore
- 24.2 使用dump备份
- 24.4 使用restore恢复
- 学习视频来自于B站【小白入门 通俗易懂】2021韩顺平 一周学会Linux。
- 可能会用到的资料有如下所示,下载链接见文末:
- 《鸟哥的Linux私房菜 基础学习篇 第四版》1
- 《鸟哥的Linux私房菜 服务器架设篇 第三版》2
- 《韩顺平_2021图解Linux全面升级》3
24.1 安装dump和restore
在学习Linux的过程中,我们一直用VMware新建虚拟机来进行开发,并且即使有rm -rf /*之类的骚操作也可以使用“快照”来进行恢复。但在工作环境下,实体机无法做快照,如果出现严重的异常或者数据损坏,甚至要重做系统,就会造成数据丢失,所以我们就需要“备份和恢复”。linux的备份和恢复很简单,有两种方式:
- 把需要的文件(或者分区)用
tar指令打包,下次需要恢复的时候,再解压开覆盖即可。- 使用
dump和restore命令——dump指令备份、restore指令还原。注:备份的重要数据时应上传到其他服务器,不要将所有数据都放在一台机器上。
注:dump指令配合crontab定时调度指令显然可以实现无人值守备份。
上图展示了在Linux备份与恢复中一个非常重要的概念——“备份层级”。以备份/boot分区为例,在当第一次备份时,显然需要将/boot分区完整的备份一遍(备份层级0);但日常一般不会对整个/boot分区进行大的删改,但可能会设计到某些文件的删改,此时为了不重新完整的备份一遍浪费资源,便可以只对上次备份过后新增的删改进行备份(备份层级1)。也就是说,除了备份层级0是完整备份,剩下的备份层级都是在上一级备份的基础上,进行“增量备份”。注意两个要点:
- 备份层级只有0~9。到达备份层级9之后会回退到备份层级0重新开始。
- “备份层级”的概念只存在于“分区”的备份,对于普通文件/目录只有“备份层级0”。
Linux下使用dump进行备份,使用restore指令进行还原。下面展示如何安装dump和restore:
################## 指令速览 #####################
yum -y install dump # 安装dump
yum -y install restore # 安装restore################## 实际演示 #####################
# 1. 安装dump
[root@CentOS76 ~]# yum -y install dump
已加载插件:fastestmirror, langpacks
Loading mirror speeds from cached hostfile* base: mirrors.ustc.edu.cn* extras: mirrors.ustc.edu.cn* updates: mirrors.ustc.edu.cn
base | 3.6 kB 00:00:00
extras | 2.9 kB 00:00:00
updates | 2.9 kB 00:00:00
正在解决依赖关系
--> 正在检查事务
---> 软件包 dump.x86_64.1.0.4-0.23.b44.el7 将被 安装
--> 正在处理依赖关系 rmt,它被软件包 1:dump-0.4-0.23.b44.el7.x86_64 需要
--> 正在检查事务
---> 软件包 rmt.x86_64.2.1.5.2-13.el7 将被 安装
--> 解决依赖关系完成依赖关系解决=======================================================================================================Package 架构 版本 源 大小
=======================================================================================================
正在安装:dump x86_64 1:0.4-0.23.b44.el7 base 148 k
为依赖而安装:rmt x86_64 2:1.5.2-13.el7 base 103 k事务概要
=======================================================================================================
安装 1 软件包 (+1 依赖软件包)总下载量:251 k
安装大小:581 k
Downloading packages:
(1/2): dump-0.4-0.23.b44.el7.x86_64.rpm | 148 kB 00:00:00
(2/2): rmt-1.5.2-13.el7.x86_64.rpm | 103 kB 00:00:00
-------------------------------------------------------------------------------------------------------
总计 611 kB/s | 251 kB 00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction正在安装 : 2:rmt-1.5.2-13.el7.x86_64 1/2 正在安装 : 1:dump-0.4-0.23.b44.el7.x86_64 2/2 验证中 : 2:rmt-1.5.2-13.el7.x86_64 1/2 验证中 : 1:dump-0.4-0.23.b44.el7.x86_64 2/2 已安装:dump.x86_64 1:0.4-0.23.b44.el7 作为依赖被安装:rmt.x86_64 2:1.5.2-13.el7 完毕!# 2. 安装restore
[root@CentOS76 ~]# yum -y install restore
已加载插件:fastestmirror, langpacks
Loading mirror speeds from cached hostfile* base: mirrors.ustc.edu.cn* extras: mirrors.ustc.edu.cn* updates: mirrors.ustc.edu.cn
没有可用软件包 restore。
错误:无须任何处理
# 注意上述报错,可能是因为安装dump时顺便安装上了restore# 3. 检验dump和restore是否安装上
[root@CentOS76 ~]# dump
dump 0.4b44 (using libext2fs 1.42.9 of 28-Dec-2013)
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] filesystemdump [-W | -w]
[root@CentOS76 ~]# restore
restore 0.4b44 (using libext2fs 1.42.9 of 28-Dec-2013)
usage: restore -C [-cdeHlMvVy] [-b blocksize] [-D filesystem] [-E mls] [-f file] [-F script] [-L limit] [-s fileno]restore -i [-acdehHlmMouvVy] [-A file] [-b blocksize] [-E mls] [-f file] [-F script] [-Q file] [-s fileno]restore -P file [-acdhHlmMuvVy] [-b blocksize][-f file] [-F script] [-s fileno] [-X filelist] [file ...]restore -r [-cdeHlMuvVy] [-b blocksize] [-E mls] [-f file] [-F script] [-s fileno] [-T directory]restore -R [-cdeHlMuvVy] [-b blocksize] [-E mls] [-f file] [-F script] [-s fileno] [-T directory]restore -t [-cdhHlMuvVy] [-A file] [-b blocksize][-f file] [-F script] [-Q file] [-s fileno] [-X filelist] [file ...]restore -x [-acdehHlmMouvVy] [-A file] [-b blocksize] [-E mls] [-f file] [-F script] [-Q file] [-s fileno] [-X filelist] [file ...]
24.2 使用dump备份
dump为备份工具程序,可将目录或整个文件系统备份至指定的设备,同时支持对整个分区进行增量备份。所谓“增量备份”是指只备份上次备份后 新修改/增加 过的文件,而无需再重新进行完整的备份,也称差异备份。注意上述仅对分区进行备份时支持“增量备份”,普通文件或目录只能使用0级别备份。下面是dump的基本语法:
# 基本语法-dump
dump [选项参数] [目录或文件系统]
dump [-wW]# 常用选项-dump
-0123456789 备份的层级。0为最完整备份,会备份所有文件。若指定0以上的层级,则备份至上一次备份以来修改或新增的文件,到9后可以再次从0开始。
-u 备份完毕后,在/etc/dumpdares中记录备份的文件系统、层级、日期、时间等。
-j 调用bzlib库压缩备份文件,也就是将备份后的文件压缩成bz2格式,让文件更小。
-f<备份后文件名> 指定备份后文件名。
-T<日期> 指定开始备份的时间与日期。
-c 修改备份磁带预设的密度与容量。
-t 指定文件名,若该文件已存在备份文件中,则列出名称。
-W 显示需要备份的文件及其最后一次备份的层级、时间、日期。
-w 与-W类似,但仅显示需要备份的文件。# 常用指令-dump
dump -W # 显示需要备份的文件及其最后一次备份的层级、时间、日期
cat /etc/dumpdates # 查看备份时间、文件、次数
下面展示四个dump应用案例:
【案例1】将/boot分区所有内容备份到/opt/boot.bak0.bz2文件中,备份层级为“0”。
################## 指令速览 #####################
dump -0uj -f /opt/boot.bak0.bz2 /boot################## 实际演示 #####################
[root@CentOS76 ~]# cd /opt
[root@CentOS76 opt]# dump -0uj -f /opt/boot.bak0.bz2 /bootDUMP: Date of this level 0 dump: Fri Aug 25 16:20:28 2023DUMP: Dumping /dev/sda1 (/boot) to /opt/boot.bak0.bz2DUMP: Label: noneDUMP: Writing 10 Kilobyte recordsDUMP: Compressing output at compression level 2 (bzlib)DUMP: mapping (Pass I) [regular files]DUMP: mapping (Pass II) [directories]DUMP: estimated 179588 blocks.DUMP: Volume 1 started with block 1 at: Fri Aug 25 16:20:28 2023DUMP: dumping (Pass III) [directories]DUMP: dumping (Pass IV) [regular files]DUMP: Closing /opt/boot.bak0.bz2DUMP: Volume 1 completed at: Fri Aug 25 16:20:41 2023DUMP: Volume 1 took 0:00:13DUMP: Volume 1 transfer rate: 12457 kB/sDUMP: Volume 1 180210kB uncompressed, 161941kB compressed, 1.113:1DUMP: 180210 blocks (175.99MB) on 1 volume(s)DUMP: finished in 13 seconds, throughput 13862 kBytes/secDUMP: Date of this level 0 dump: Fri Aug 25 16:20:28 2023DUMP: Date this dump completed: Fri Aug 25 16:20:41 2023DUMP: Average transfer rate: 12457 kB/sDUMP: Wrote 180210kB uncompressed, 161941kB compressed, 1.113:1DUMP: DUMP IS DONE
[root@CentOS76 opt]# ll -h
总用量 305M
-rw-r--r--. 1 root root 159M 8月 25 16:20 boot.bak0.bz2
# 其他的文件就不显示了,注意备份文件大小为159M
【案例2】在/boot目录下新建一个hello.txt,然后将/boot分区增量备份到/opt/boot.bak1.bz2文件中(备份层级1)。
此例可发现:
- 备份层级0文件
boot.bak0.bz2大小:159M。- 备份层级1文件
boot.bak1.bz2大小:12K。
################## 指令速览 #####################
dump -1uj -f /opt/boot.bak1.bz2 /boot################## 实际演示 #####################
[root@CentOS76 opt]# cd /boot
[root@CentOS76 boot]# touch hello.txt
[root@CentOS76 boot]# ll -h
总用量 159M
-rw-r--r--. 1 root root 0 8月 25 16:23 hello.txt
# /boot目录下其他的就不显示了
[root@CentOS76 boot]# dump -1uj -f /opt/boot.bak1.bz2 /bootDUMP: Date of this level 1 dump: Fri Aug 25 16:24:20 2023DUMP: Date of last level 0 dump: Fri Aug 25 16:20:28 2023DUMP: Dumping /dev/sda1 (/boot) to /opt/boot.bak1.bz2DUMP: Label: noneDUMP: Writing 10 Kilobyte recordsDUMP: Compressing output at compression level 2 (bzlib)DUMP: mapping (Pass I) [regular files]DUMP: mapping (Pass II) [directories]DUMP: estimated 35 blocks.DUMP: Volume 1 started with block 1 at: Fri Aug 25 16:24:20 2023DUMP: dumping (Pass III) [directories]DUMP: dumping (Pass IV) [regular files]DUMP: Closing /opt/boot.bak1.bz2DUMP: Volume 1 completed at: Fri Aug 25 16:24:20 2023DUMP: 30 blocks (0.03MB) on 1 volume(s)DUMP: finished in less than a secondDUMP: Date of this level 1 dump: Fri Aug 25 16:24:20 2023DUMP: Date this dump completed: Fri Aug 25 16:24:20 2023DUMP: Average transfer rate: 0 kB/sDUMP: Wrote 30kB uncompressed, 11kB compressed, 2.728:1DUMP: DUMP IS DONE
[root@CentOS76 boot]# ll -h /opt
总用量 305M
-rw-r--r--. 1 root root 159M 8月 25 16:20 boot.bak0.bz2
-rw-r--r--. 1 root root 12K 8月 25 16:24 boot.bak1.bz2
# /opt目录下其他的文档就不显示了
【案例3】查看使用dump备份的文件及其最后一次备份的层级、时间、日期。
################## 指令速览 #####################
dump -W
cat /etc/dumpdates################## 实际演示 #####################
[root@CentOS76 boot]# dump -W
Last dump(s) done (Dump '>' file systems):
> /dev/sda3 ( /) Last dump: never/dev/sda1 ( /boot) Last dump: Level 1, Date Fri Aug 25 16:24:20 2023[root@CentOS76 boot]# cat /etc/dumpdates
/dev/sda1 0 Fri Aug 25 16:20:28 2023 +0800
/dev/sda1 1 Fri Aug 25 16:24:20 2023 +0800
【案例4】使用dump备份/etc整个目录。
- 注意“实际演示”还演示了普通文件不支持备份层级1、不支持选项
-u。
################## 指令速览 #####################
dump -0j -f /opt/etc.bak.bz2 /etc/
# 下面一行指令报错!提示子目录只能使用备份层级0!
# dump -1j -f /opt/etc.bak.bz2 /etc/################## 实际演示 #####################
# 1. 演示dump使用“备份层级0”备份普通目录/etc
[root@CentOS76 boot]# dump -0j -f /opt/etc.bak0.bz2 /etc/DUMP: Date of this level 0 dump: Fri Aug 25 16:33:29 2023DUMP: Dumping /dev/sda3 (/ (dir etc)) to /opt/etc.bak0.bz2DUMP: Label: noneDUMP: Writing 10 Kilobyte recordsDUMP: Compressing output at compression level 2 (bzlib)DUMP: mapping (Pass I) [regular files]DUMP: mapping (Pass II) [directories]DUMP: estimated 68703 blocks.DUMP: Volume 1 started with block 1 at: Fri Aug 25 16:33:30 2023DUMP: dumping (Pass III) [directories]DUMP: dumping (Pass IV) [regular files]DUMP: Closing /opt/etc.bak0.bz2DUMP: Volume 1 completed at: Fri Aug 25 16:33:33 2023DUMP: Volume 1 took 0:00:03DUMP: Volume 1 transfer rate: 8208 kB/sDUMP: Volume 1 78350kB uncompressed, 24626kB compressed, 3.182:1DUMP: 78350 blocks (76.51MB) on 1 volume(s)DUMP: finished in 3 seconds, throughput 26116 kBytes/secDUMP: Date of this level 0 dump: Fri Aug 25 16:33:29 2023DUMP: Date this dump completed: Fri Aug 25 16:33:33 2023DUMP: Average transfer rate: 8208 kB/sDUMP: Wrote 78350kB uncompressed, 24626kB compressed, 3.182:1DUMP: DUMP IS DONE
[root@CentOS76 boot]# ll -h /opt
总用量 353M
-rw-r--r--. 1 root root 159M 8月 25 16:20 boot.bak0.bz2
-rw-r--r--. 1 root root 12K 8月 25 16:24 boot.bak1.bz2
-rw-r--r--. 1 root root 25M 8月 25 16:33 etc.bak0.bz2
# /opt目录下其他的文档就不显示了# 2. 演示dump不支持使用“备份层级1”备份普通目录/etc
[root@CentOS76 boot]# dump -1j -f /opt/etc.bak1.bz2 /etc/DUMP: Only level 0 dumps are allowed on a subdirectoryDUMP: The ENTIRE dump is aborted.# 3. 演示dump不支持使用“选项-u”备份普通目录/etc
[root@CentOS76 boot]# dump -0uj -f /opt/etc.bak0.bz2 /etc/DUMP: You can't update the dumpdates file when dumping a subdirectoryDUMP: The ENTIRE dump is aborted.
24.4 使用restore恢复
上一节讲了如何使用dump指令进行备份,本节就来介绍如何使用restore指令将备份的文件恢复到指令目录中。只需要注意,若有多个备份层级,从备份层级0开始依次恢复即可。下面是restore指令的基本语法:
# 基本语法-restore
restore [模式选项] [选项]# 模式选项-restore
# 说明:下面四个模式不能混用!一次命令中只能指定一种。
-C 对比模式。将备份的文件与已存在的文件相互对比。
-i 交互模式。在进行还原操作时,restore指令将依序询问用户。
-r 还原模式【使用最多】。有多个备份层级时,从0开始依次还原即可。
-t 查看模式。看备份文件有哪些文件。
# 常用选项-restore
-f<备份设备> 从指定的文件中读取备份数据,进行还原操作# 常用指令-restore
restore -r -f<备份好的文件>
下面展示四个restore指令的应用案例:
【案例1】将/boot/hello.txt文件重命名为hello1.txt,然后使用restore指令的“对比模式”,比较备份文件/opt/boot.bak1.bz2和原目录/boot的区别。
################## 指令速览 #####################
mv /boot/hello.txt /boot/hello1.txt # 重命名/boot/hello.txt
restore -C -f boot.bak1.bz2 # 注意和最新的文件比较################## 实际演示 #####################
# 1. 将文件重命名
[root@CentOS76 boot]# ll -h
总用量 159M
-rw-r--r--. 1 root root 0 8月 25 16:23 hello.txt
# /opt目录下其他的文档就不显示了
[root@CentOS76 boot]# mv /boot/hello.txt /boot/hello1.txt
[root@CentOS76 boot]# ll -h
总用量 159M
-rw-r--r--. 1 root root 0 8月 25 16:23 hello1.txt
# /opt目录下其他的文档就不显示了# 2. 使用“对比模式”查看当前目录与备份文件的区别
[root@CentOS76 boot]# restore -C -f /opt/boot.bak1.bz2
Dump tape is compressed.
Dump date: Fri Aug 25 16:24:20 2023
Dumped from: Fri Aug 25 16:20:28 2023
Level 1 dump of /boot on CentOS76:/dev/sda1
Label: none
filesys = /boot
restore: unable to stat ./hello.txt: No such file or directory
Some files were modified! 1 compare errors
# 注意上述有1个compare errors。# 3. 再将/boot/hello1.txt文件名改回去,重新使用“对比模式”查看
[root@CentOS76 boot]# mv /boot/hello1.txt /boot/hello.txt
[root@CentOS76 boot]# restore -C -f /opt/boot.bak1.bz2
Dump tape is compressed.
Dump date: Fri Aug 25 16:24:20 2023
Dumped from: Fri Aug 25 16:20:28 2023
Level 1 dump of /boot on CentOS76:/dev/sda1
Label: none
filesys = /boot
【案例2】使用restore指令的“查看模式”,看备份文件/opt/boot.bak0.bz2有哪些数据/文件。
################## 指令速览 #####################
restore -t -f /opt/boot.bak0.bz2################## 实际演示 #####################
# 1. 看看备份层级1中的文件都记录了啥
[root@CentOS76 boot]# restore -t -f /opt/boot.bak1.bz2
Dump tape is compressed.
Dump date: Fri Aug 25 16:24:20 2023
Dumped from: Fri Aug 25 16:20:28 2023
Level 1 dump of /boot on CentOS76:/dev/sda1
Label: none2 .346 ./hello.txt# 2. 看看备份层级0的文件中都记录了啥
[root@CentOS76 boot]# restore -t -f /opt/boot.bak0.bz2
Dump tape is compressed.
Dump date: Fri Aug 25 16:20:28 2023
Dumped from: the epoch
Level 0 dump of /boot on CentOS76:/dev/sda1
Label: none2 .11 ./lost+found12 ./efi13 ./efi/EFI14 ./efi/EFI/centos22 ./efi/EFI/centos/MokManager.efi20 ./efi/EFI/centos/BOOT.CSV21 ./efi/EFI/centos/BOOTX64.CSV25 ./efi/EFI/centos/shimx64-centos.efi23 ./efi/EFI/centos/mmx64.efi24 ./efi/EFI/centos/shim.efi27 ./efi/EFI/centos/fw26 ./efi/EFI/centos/shimx64.efi28 ./efi/EFI/centos/fwupia32.efi29 ./efi/EFI/centos/fwupx64.efi16 ./efi/EFI/BOOT18 ./efi/EFI/BOOT/fallback.efi17 ./efi/EFI/BOOT/BOOTX64.EFI19 ./efi/EFI/BOOT/fbx64.efi8193 ./grub238 ./grub2/device.map39 ./grub2/i386-pc41 ./grub2/i386-pc/usbtest.mod43 ./grub2/i386-pc/nativedisk.mod45 ./grub2/i386-pc/ldm.mod46 ./grub2/i386-pc/crypto.mod48 ./grub2/i386-pc/part_acorn.mod49 ./grub2/i386-pc/spkmodem.mod52 ./grub2/i386-pc/gcry_dsa.mod54 ./grub2/i386-pc/hashsum.mod56 ./grub2/i386-pc/gcry_md5.mod57 ./grub2/i386-pc/testspeed.mod58 ./grub2/i386-pc/gcry_serpent.mod59 ./grub2/i386-pc/keylayouts.mod60 ./grub2/i386-pc/bitmap_scale.mod64 ./grub2/i386-pc/file.mod67 ./grub2/i386-pc/sfs.mod68 ./grub2/i386-pc/at_keyboard.mod69 ./grub2/i386-pc/aout.mod70 ./grub2/i386-pc/mda_text.mod71 ./grub2/i386-pc/minix2_be.mod72 ./grub2/i386-pc/gfxterm.mod75 ./grub2/i386-pc/halt.mod78 ./grub2/i386-pc/mmap.mod79 ./grub2/i386-pc/squash4.mod81 ./grub2/i386-pc/minix2.mod83 ./grub2/i386-pc/syslinuxcfg.mod84 ./grub2/i386-pc/regexp.mod85 ./grub2/i386-pc/ls.mod86 ./grub2/i386-pc/bufio.mod88 ./grub2/i386-pc/romfs.mod89 ./grub2/i386-pc/exfctest.mod91 ./grub2/i386-pc/ufs1_be.mod92 ./grub2/i386-pc/odc.mod93 ./grub2/i386-pc/gdb.mod95 ./grub2/i386-pc/priority_queue.mod98 ./grub2/i386-pc/part_dvh.mod101 ./grub2/i386-pc/sendkey.mod102 ./grub2/i386-pc/cmdline_cat_test.mod106 ./grub2/i386-pc/sleep_test.mod110 ./grub2/i386-pc/test.mod113 ./grub2/i386-pc/dm_nv.mod114 ./grub2/i386-pc/usbserial_common.mod115 ./grub2/i386-pc/jpeg.mod120 ./grub2/i386-pc/vga_text.mod124 ./grub2/i386-pc/test_blockarg.mod128 ./grub2/i386-pc/echo.mod130 ./grub2/i386-pc/part_apple.mod131 ./grub2/i386-pc/gcry_des.mod133 ./grub2/i386-pc/gcry_md4.mod134 ./grub2/i386-pc/boot.mod137 ./grub2/i386-pc/parttool.mod138 ./grub2/i386-pc/zfs.mod140 ./grub2/i386-pc/part_sunpc.mod141 ./grub2/i386-pc/geli.mod142 ./grub2/i386-pc/http.mod143 ./grub2/i386-pc/efiemu.mod145 ./grub2/i386-pc/terminal.mod147 ./grub2/i386-pc/pxechain.mod148 ./grub2/i386-pc/datetime.mod154 ./grub2/i386-pc/ext2.mod155 ./grub2/i386-pc/affs.mod159 ./grub2/i386-pc/linux16.mod160 ./grub2/i386-pc/hexdump.mod163 ./grub2/i386-pc/lzopio.mod164 ./grub2/i386-pc/biosdisk.mod165 ./grub2/i386-pc/gzio.mod167 ./grub2/i386-pc/cpio_be.mod168 ./grub2/i386-pc/testload.mod169 ./grub2/i386-pc/multiboot2.mod175 ./grub2/i386-pc/verify.mod178 ./grub2/i386-pc/ntfs.mod181 ./grub2/i386-pc/help.mod183 ./grub2/i386-pc/gcry_rmd160.mod184 ./grub2/i386-pc/backtrace.mod186 ./grub2/i386-pc/password_pbkdf2.mod188 ./grub2/i386-pc/gcry_rijndael.mod189 ./grub2/i386-pc/udf.mod190 ./grub2/i386-pc/usbserial_pl2303.mod191 ./grub2/i386-pc/legacy_password_test.mod192 ./grub2/i386-pc/lsacpi.mod199 ./grub2/i386-pc/mdraid09_be.mod201 ./grub2/i386-pc/fshelp.mod202 ./grub2/i386-pc/search_fs_file.mod203 ./grub2/i386-pc/minix3.mod204 ./grub2/i386-pc/gcry_sha1.mod205 ./grub2/i386-pc/png.mod206 ./grub2/i386-pc/fat.mod209 ./grub2/i386-pc/relocator.mod212 ./grub2/i386-pc/ufs2.mod213 ./grub2/i386-pc/bitmap.mod214 ./grub2/i386-pc/minix.mod216 ./grub2/i386-pc/memrw.mod220 ./grub2/i386-pc/reboot.mod223 ./grub2/i386-pc/macbless.mod224 ./grub2/i386-pc/macho.mod226 ./grub2/i386-pc/cmosdump.mod227 ./grub2/i386-pc/cbls.mod230 ./grub2/i386-pc/gcry_crc.mod231 ./grub2/i386-pc/gcry_camellia.mod234 ./grub2/i386-pc/usbms.mod237 ./grub2/i386-pc/gcry_cast5.mod240 ./grub2/i386-pc/minicmd.mod241 ./grub2/i386-pc/gcry_tiger.mod242 ./grub2/i386-pc/cbmemc.mod243 ./grub2/i386-pc/uhci.mod245 ./grub2/i386-pc/gcry_rfc2268.mod246 ./grub2/i386-pc/pcidump.mod248 ./grub2/i386-pc/gcry_sha512.mod252 ./grub2/i386-pc/pci.mod255 ./grub2/i386-pc/xfs.mod262 ./grub2/i386-pc/ntfscomp.mod263 ./grub2/i386-pc/raid5rec.mod268 ./grub2/i386-pc/xnu_uuid.mod269 ./grub2/i386-pc/exfat.mod271 ./grub2/i386-pc/usbserial_usbdebug.mod272 ./grub2/i386-pc/setpci.mod273 ./grub2/i386-pc/reiserfs.mod276 ./grub2/i386-pc/hfs.mod278 ./grub2/i386-pc/minix3_be.mod279 ./grub2/i386-pc/ufs1.mod281 ./grub2/i386-pc/bfs.mod283 ./grub2/i386-pc/eval.mod284 ./grub2/i386-pc/tga.mod285 ./grub2/i386-pc/mdraid1x.mod286 ./grub2/i386-pc/gcry_rsa.mod288 ./grub2/i386-pc/ata.mod289 ./grub2/i386-pc/archelp.mod292 ./grub2/i386-pc/gcry_sha256.mod295 ./grub2/i386-pc/blocklist.mod296 ./grub2/i386-pc/cpuid.mod297 ./grub2/i386-pc/part_plan.mod298 ./grub2/i386-pc/moddep.lst299 ./grub2/i386-pc/command.lst305 ./grub2/i386-pc/terminal.lst345 ./grub2/i386-pc/boot.img177 ./grub2/i386-pc/font.mod236 ./grub2/i386-pc/video_bochs.mod123 ./grub2/i386-pc/cryptodisk.mod144 ./grub2/i386-pc/drivemap.mod87 ./grub2/i386-pc/gcry_whirlpool.mod119 ./grub2/i386-pc/part_amiga.mod235 ./grub2/i386-pc/ntldr.mod74 ./grub2/i386-pc/part_bsd.mod44 ./grub2/i386-pc/diskfilter.mod139 ./grub2/i386-pc/video_colors.mod76 ./grub2/i386-pc/morse.mod97 ./grub2/i386-pc/vga.mod62 ./grub2/i386-pc/functional_test.mod170 ./grub2/i386-pc/elf.mod158 ./grub2/i386-pc/ohci.mod80 ./grub2/i386-pc/setjmp.mod116 ./grub2/i386-pc/configfile.mod135 ./grub2/i386-pc/msdospart.mod211 ./grub2/i386-pc/all_video.mod210 ./grub2/i386-pc/afs.mod182 ./grub2/i386-pc/signature_test.mod77 ./grub2/i386-pc/cs5536.mod180 ./grub2/i386-pc/minix_be.mod229 ./grub2/i386-pc/progress.mod174 ./grub2/i386-pc/sleep.mod225 ./grub2/i386-pc/memdisk.mod215 ./grub2/i386-pc/bsd.mod176 ./grub2/i386-pc/play.mod108 ./grub2/i386-pc/gcry_blowfish.mod198 ./grub2/i386-pc/gfxterm_background.mod94 ./grub2/i386-pc/lspci.mod132 ./grub2/i386-pc/disk.mod111 ./grub2/i386-pc/plan9.mod104 ./grub2/i386-pc/xnu.mod129 ./grub2/i386-pc/btrfs.mod66 ./grub2/i386-pc/videoinfo.mod53 ./grub2/i386-pc/gcry_twofish.mod200 ./grub2/i386-pc/probe.mod166 ./grub2/i386-pc/usb.mod103 ./grub2/i386-pc/chain.mod125 ./grub2/i386-pc/hfspluscomp.mod118 ./grub2/i386-pc/extcmd.mod63 ./grub2/i386-pc/iso9660.mod193 ./grub2/i386-pc/mpi.mod51 ./grub2/i386-pc/lsmmap.mod50 ./grub2/i386-pc/videotest.mod47 ./grub2/i386-pc/keystatus.mod196 ./grub2/i386-pc/iorw.mod73 ./grub2/i386-pc/lvm.mod105 ./grub2/i386-pc/truecrypt.mod121 ./grub2/i386-pc/gcry_idea.mod218 ./grub2/i386-pc/trig.mod122 ./grub2/i386-pc/tftp.mod208 ./grub2/i386-pc/procfs.mod99 ./grub2/i386-pc/part_gpt.mod232 ./grub2/i386-pc/loadenv.mod156 ./grub2/i386-pc/videotest_checksum.mod61 ./grub2/i386-pc/hdparm.mod197 ./grub2/i386-pc/net.mod221 ./grub2/i386-pc/search_label.mod151 ./grub2/i386-pc/raid6rec.mod161 ./grub2/i386-pc/jfs.mod100 ./grub2/i386-pc/tr.mod194 ./grub2/i386-pc/cbtable.mod42 ./grub2/i386-pc/video.mod195 ./grub2/i386-pc/usbserial_ftdi.mod187 ./grub2/i386-pc/cmostest.mod146 ./grub2/i386-pc/datehook.mod152 ./grub2/i386-pc/scsi.mod65 ./grub2/i386-pc/usb_keyboard.mod153 ./grub2/i386-pc/xnu_uuid_test.mod173 ./grub2/i386-pc/video_fb.mod233 ./grub2/i386-pc/pata.mod228 ./grub2/i386-pc/date.mod127 ./grub2/i386-pc/password.mod162 ./grub2/i386-pc/setjmp_test.mod55 ./grub2/i386-pc/hfsplus.mod172 ./grub2/i386-pc/gcry_seed.mod82 ./grub2/i386-pc/multiboot.mod219 ./grub2/i386-pc/time.mod136 ./grub2/i386-pc/serial.mod109 ./grub2/i386-pc/freedos.mod185 ./grub2/i386-pc/cpio.mod238 ./grub2/i386-pc/tar.mod217 ./grub2/i386-pc/div_test.mod179 ./grub2/i386-pc/part_msdos.mod171 ./grub2/i386-pc/ahci.mod157 ./grub2/i386-pc/search_fs_uuid.mod126 ./grub2/i386-pc/search.mod107 ./grub2/i386-pc/cmp.mod150 ./grub2/i386-pc/cbfs.mod207 ./grub2/i386-pc/mdraid09.mod90 ./grub2/i386-pc/gptsync.mod149 ./grub2/i386-pc/blscfg.mod222 ./grub2/i386-pc/lsapm.mod112 ./grub2/i386-pc/acpi.mod117 ./grub2/i386-pc/linux.mod96 ./grub2/i386-pc/ehci.mod239 ./grub2/i386-pc/pbkdf2.mod244 ./grub2/i386-pc/xzio.mod247 ./grub2/i386-pc/pxe.mod249 ./grub2/i386-pc/nilfs2.mod250 ./grub2/i386-pc/read.mod251 ./grub2/i386-pc/loopback.mod253 ./grub2/i386-pc/adler32.mod254 ./grub2/i386-pc/zfscrypt.mod256 ./grub2/i386-pc/gcry_arcfour.mod257 ./grub2/i386-pc/part_dfly.mod258 ./grub2/i386-pc/gfxmenu.mod259 ./grub2/i386-pc/true.mod260 ./grub2/i386-pc/crc64.mod261 ./grub2/i386-pc/cat.mod264 ./grub2/i386-pc/pbkdf2_test.mod265 ./grub2/i386-pc/hello.mod266 ./grub2/i386-pc/vbe.mod267 ./grub2/i386-pc/gettext.mod270 ./grub2/i386-pc/cbtime.mod274 ./grub2/i386-pc/luks.mod275 ./grub2/i386-pc/gfxterm_menu.mod277 ./grub2/i386-pc/normal.mod280 ./grub2/i386-pc/legacycfg.mod282 ./grub2/i386-pc/offsetio.mod287 ./grub2/i386-pc/newc.mod290 ./grub2/i386-pc/part_sun.mod291 ./grub2/i386-pc/zfsinfo.mod293 ./grub2/i386-pc/terminfo.mod294 ./grub2/i386-pc/video_cirrus.mod300 ./grub2/i386-pc/fs.lst301 ./grub2/i386-pc/partmap.lst302 ./grub2/i386-pc/parttool.lst303 ./grub2/i386-pc/video.lst304 ./grub2/i386-pc/crypto.lst306 ./grub2/i386-pc/modinfo.sh344 ./grub2/i386-pc/core.img40 ./grub2/locale307 ./grub2/locale/en@cyrillic.mo308 ./grub2/locale/da.mo309 ./grub2/locale/fr.mo310 ./grub2/locale/gl.mo311 ./grub2/locale/id.mo312 ./grub2/locale/en@arabic.mo313 ./grub2/locale/de_CH.mo314 ./grub2/locale/zh_TW.mo315 ./grub2/locale/it.mo316 ./grub2/locale/de@hebrew.mo317 ./grub2/locale/ca.mo318 ./grub2/locale/de.mo319 ./grub2/locale/en@greek.mo320 ./grub2/locale/zh_CN.mo321 ./grub2/locale/ast.mo322 ./grub2/locale/es.mo323 ./grub2/locale/tr.mo324 ./grub2/locale/sl.mo325 ./grub2/locale/pa.mo326 ./grub2/locale/fi.mo327 ./grub2/locale/pt_BR.mo328 ./grub2/locale/eo.mo329 ./grub2/locale/hu.mo330 ./grub2/locale/ru.mo331 ./grub2/locale/vi.mo332 ./grub2/locale/nl.mo333 ./grub2/locale/en@quot.mo334 ./grub2/locale/uk.mo335 ./grub2/locale/en@piglatin.mo336 ./grub2/locale/ja.mo337 ./grub2/locale/en@hebrew.mo338 ./grub2/locale/lt.mo339 ./grub2/locale/pl.mo340 ./grub2/locale/sv.mo341 ./grub2/fonts342 ./grub2/fonts/unicode.pf2343 ./grub2/grubenv353 ./grub2/grub.cfg8194 ./grub15 ./grub/splash.xpm.gz35 ./initramfs-3.10.0-1160.el7.x86_64.img30 ./.vmlinuz-3.10.0-1160.el7.x86_64.hmac31 ./System.map-3.10.0-1160.el7.x86_6432 ./config-3.10.0-1160.el7.x86_6433 ./symvers-3.10.0-1160.el7.x86_64.gz34 ./vmlinuz-3.10.0-1160.el7.x86_6436 ./initramfs-0-rescue-0d4bcac3ad0e4afe96e50f962baa9f7d.img37 ./vmlinuz-0-rescue-0d4bcac3ad0e4afe96e50f962baa9f7d352 ./initramfs-3.10.0-1160.95.1.el7.x86_64.img347 ./.vmlinuz-3.10.0-1160.95.1.el7.x86_64.hmac348 ./System.map-3.10.0-1160.95.1.el7.x86_64349 ./config-3.10.0-1160.95.1.el7.x86_64350 ./symvers-3.10.0-1160.95.1.el7.x86_64.gz351 ./vmlinuz-3.10.0-1160.95.1.el7.x86_64
【案例3】使用restore指令的“还原模式”,将/boot目录的备份还原到/opt/boottmp目录中。
################## 指令速览 #####################
mkdir /opt/boottmp
cd /opt/boottmp
restore -r -f /opt/boot.bak0.bz2 # 恢复备份层级0
restore -r -f /opt/boot.bak1.bz2 # 恢复备份层级1################## 实际演示 #####################
# 1. 恢复备份层级0
[root@CentOS76 boot]# mkdir /opt/boottmp
[root@CentOS76 boot]# cd /opt/boottmp/
[root@CentOS76 boottmp]# restore -r -f /opt/boot.bak0.bz2
Dump tape is compressed.
[root@CentOS76 boottmp]# ll -h
总用量 160M
-rw-r--r--. 1 root root 151K 7月 24 22:03 config-3.10.0-1160.95.1.el7.x86_64
-rw-r--r--. 1 root root 150K 10月 20 2020 config-3.10.0-1160.el7.x86_64
drwx------. 3 root root 4.0K 7月 29 2020 efi
drwxr-xr-x. 2 root root 4.0K 7月 13 17:07 grub
drwx------. 5 root root 4.0K 8月 25 11:17 grub2
-rw-------. 1 root root 77M 7月 13 17:10 initramfs-0-rescue-0d4bcac3ad0e4afe96e50f962baa9f7d.img
-rw-------. 1 root root 28M 8月 25 11:17 initramfs-3.10.0-1160.95.1.el7.x86_64.img
-rw-------. 1 root root 28M 7月 13 17:12 initramfs-3.10.0-1160.el7.x86_64.img
drwx------. 2 root root 4.0K 7月 13 17:06 lost+found
-rw-------. 1 root root 143K 8月 25 17:01 restoresymtable
-rw-r--r--. 1 root root 314K 7月 24 22:04 symvers-3.10.0-1160.95.1.el7.x86_64.gz
-rw-r--r--. 1 root root 314K 10月 20 2020 symvers-3.10.0-1160.el7.x86_64.gz
-rw-------. 1 root root 3.5M 7月 24 22:03 System.map-3.10.0-1160.95.1.el7.x86_64
-rw-------. 1 root root 3.5M 10月 20 2020 System.map-3.10.0-1160.el7.x86_64
-rwxr-xr-x. 1 root root 6.5M 7月 13 17:10 vmlinuz-0-rescue-0d4bcac3ad0e4afe96e50f962baa9f7d
-rwxr-xr-x. 1 root root 6.8M 7月 24 22:03 vmlinuz-3.10.0-1160.95.1.el7.x86_64
-rwxr-xr-x. 1 root root 6.5M 10月 20 2020 vmlinuz-3.10.0-1160.el7.x86_64
# 可以发现上述没有hello.txt# 2. 恢复备份层级1
[root@CentOS76 boottmp]# restore -r -f /opt/boot.bak1.bz2
Dump tape is compressed.
[root@CentOS76 boottmp]# ll -h
总用量 160M
-rw-r--r--. 1 root root 151K 7月 24 22:03 config-3.10.0-1160.95.1.el7.x86_64
-rw-r--r--. 1 root root 150K 10月 20 2020 config-3.10.0-1160.el7.x86_64
drwx------. 3 root root 4.0K 7月 29 2020 efi
drwxr-xr-x. 2 root root 4.0K 7月 13 17:07 grub
drwx------. 5 root root 4.0K 8月 25 11:17 grub2
-rw-r--r--. 1 root root 0 8月 25 16:23 hello.txt
-rw-------. 1 root root 77M 7月 13 17:10 initramfs-0-rescue-0d4bcac3ad0e4afe96e50f962baa9f7d.img
-rw-------. 1 root root 28M 8月 25 11:17 initramfs-3.10.0-1160.95.1.el7.x86_64.img
-rw-------. 1 root root 28M 7月 13 17:12 initramfs-3.10.0-1160.el7.x86_64.img
drwx------. 2 root root 4.0K 7月 13 17:06 lost+found
-rw-------. 1 root root 143K 8月 25 17:02 restoresymtable
-rw-r--r--. 1 root root 314K 7月 24 22:04 symvers-3.10.0-1160.95.1.el7.x86_64.gz
-rw-r--r--. 1 root root 314K 10月 20 2020 symvers-3.10.0-1160.el7.x86_64.gz
-rw-------. 1 root root 3.5M 7月 24 22:03 System.map-3.10.0-1160.95.1.el7.x86_64
-rw-------. 1 root root 3.5M 10月 20 2020 System.map-3.10.0-1160.el7.x86_64
-rwxr-xr-x. 1 root root 6.5M 7月 13 17:10 vmlinuz-0-rescue-0d4bcac3ad0e4afe96e50f962baa9f7d
-rwxr-xr-x. 1 root root 6.8M 7月 24 22:03 vmlinuz-3.10.0-1160.95.1.el7.x86_64
-rwxr-xr-x. 1 root root 6.5M 10月 20 2020 vmlinuz-3.10.0-1160.el7.x86_64
# 可以上述已经恢复出hello.txt
【案例4】使用restore指令恢复备份的文件,恢复/etc/整个目录的备份。
################## 指令速览 #####################
mkdir /opt/etctmp
cd /opt/etctmp/
restore -r -f /opt/etc.bak0.bz2################## 实际演示 #####################
[root@CentOS76 boottmp]# mkdir /opt/etctmp
[root@CentOS76 boottmp]# cd /opt/etctmp/
[root@CentOS76 etctmp]# restore -r -f /opt/etc.bak0.bz2
Dump tape is compressed.
./lost+found: (inode 11) not found on tape
./boot: (inode 655361) not found on tape
./dev: (inode 131073) not found on tape
./proc: (inode 262145) not found on tape
./run: (inode 917505) not found on tape
./sys: (inode 393217) not found on tape
./root: (inode 786433) not found on tape
./var: (inode 131074) not found on tape
./tmp: (inode 262146) not found on tape
./data: (inode 799503) not found on tape
./usr: (inode 393218) not found on tape
./bin: (inode 17) not found on tape
./sbin: (inode 16) not found on tape
./lib: (inode 13) not found on tape
./lib64: (inode 15) not found on tape
./home: (inode 655362) not found on tape
./media: (inode 917506) not found on tape
./mnt: (inode 786434) not found on tape
./opt: (inode 655363) not found on tape
./srv: (inode 917507) not found on tape
[root@CentOS76 etctmp]# ls
etc restoresymtable
[root@CentOS76 etctmp]# ls /opt/etctmp/etc
abrt firefox magic rmt
adjtime firewalld mail.rc rpc
aliases flatpak makedumpfile.conf.sample rpm
aliases.db fonts man_db.conf rsyncd.conf
alsa fprintd.conf maven rsyslog.conf
alternatives fstab mke2fs.conf rsyslog.d
anacrontab fuse.conf modprobe.d rwtab
asound.conf fwupd modules-load.d rwtab.d
at.deny gconf motd samba
audisp gcrypt mtab sane.d
audit gdbinit mtools.conf sasl2
autofs.conf gdbinit.d multipath scl
autofs_ldap_auth.conf gdm my.cnf securetty
auto.master geoclue my.cnf.d security
auto.master.d GeoIP.conf nanorc selinux
auto.misc ghostscript ndctl services
auto.net glvnd netconfig sestatus.conf
auto.smb gnupg NetworkManager setroubleshoot
avahi GREP_COLORS networks setuptool.d
bash_completion.d groff nfs.conf sgml
bashrc group nfsmount.conf shadow
binfmt.d group- nsswitch.conf shadow-
bluetooth grub2.cfg nsswitch.conf.bak shells
brltty grub.d ntp skel
brltty.conf gshadow ntp.conf smartmontools
centos-release gshadow- numad.conf sos.conf
centos-release-upstream gss oddjob speech-dispatcher
certmonger gssproxy oddjobd.conf ssh
cgconfig.conf host.conf oddjobd.conf.d ssl
cgconfig.d hostname openldap sssd
cgrules.conf hosts opt statetab
cgsnapshot_blacklist.conf hosts.allow os-release statetab.d
chkconfig.d hosts.deny PackageKit subgid
chrony.conf hp pam.d subuid
chrony.keys idmapd.conf papersize subversion
cifs-utils init.d passwd sudo.conf
cron.d inittab passwd- sudoers
cron.daily inputrc pbm2ppa.conf sudoers.d
cron.deny ipa pinforc sudo-ldap.conf
cron.hourly iproute2 pkcs11 sysconfig
cron.monthly ipsec.conf pki sysctl.conf
crontab ipsec.d plymouth sysctl.d
cron.weekly ipsec.secrets pm systemd
crypttab iscsi pnm2ppa.conf system-release
csh.cshrc issue polkit-1 system-release-cpe
csh.login issue.net popt.d target
cups java postfix tcsd.conf
cupshelpers jvm ppp terminfo
dbus-1 jvm-commmon prelink.conf.d tmpfiles.d
dconf kdump.conf printcap trusted-key.key
default kernel profile tuned
depmod.d krb5.conf profile.d udev
dhcp krb5.conf.d protocols udisks2
DIR_COLORS ksmtuned.conf pulse unbound
DIR_COLORS.256color ld.so.cache purple updatedb.conf
DIR_COLORS.lightbgcolor ld.so.conf python UPower
dleyna-server-service.conf ld.so.conf.d qemu-ga usb_modeswitch.conf
dnsmasq.conf libaudit.conf qemu-kvm vconsole.conf
dnsmasq.d libblockdev radvd.conf vimrc
dracut.conf libibverbs.d rc0.d virc
dracut.conf.d libnl rc1.d vmware-tools
dumpdates libpaper.d rc2.d wgetrc
e2fsck.conf libreport rc3.d wpa_supplicant
egl libuser.conf rc4.d wvdial.conf
enscript.cfg libvirt rc5.d X11
environment locale.conf rc6.d xdg
ethertypes localtime rc.d xinetd.d
exports login.defs rc.local xml
exports.d logrotate.conf rdma yum
favicon.png logrotate.d redhat-release yum.conf
fcoe lsm request-key.conf yum.repos.d
festival lvm request-key.d
filesystems machine-id resolv.conf
《鸟哥的Linux私房菜 基础学习篇 第四版》 ↩︎
《鸟哥的Linux私房菜 服务器架设篇 第三版》 ↩︎
《韩顺平_2021图解Linux全面升级》 ↩︎
相关文章:
24 Linux高级篇-备份与恢复
24 Linux高级篇-备份与恢复 文章目录 24 Linux高级篇-备份与恢复24.1 安装dump和restore24.2 使用dump备份24.4 使用restore恢复 学习视频来自于B站【小白入门 通俗易懂】2021韩顺平 一周学会Linux。可能会用到的资料有如下所示,下载链接见文末: 《鸟哥的…...
微信小程序的图书馆预约系统设计与实现
摘 要 近年来随着社会竞争压力的不断加剧,人们需要不断充实自己的学识来提升自己的竞争力,对于在校的大学生而言需要利用在校期间实现考研考编的内容,职场的上班族需要通过考取职业技能资格证书来实现升职加薪,各行各业的人们都在…...
《2023年网信人才培训-网络安全从业人员能力素养提升培训》第一期成功举办
随着网络强国和数字中国建设的步伐加快,建设规模宏大、结构合理、素质优良的人才队伍成为一项重要工作。知了汇智作为数字产教融合基地,通过与高校、企业等多方合作,建立了完整的网络安全人才培养生态链。凭借自身技术优势和丰富的产业资源&a…...
WebGpu VS WebGL
推荐:使用 NSDT场景编辑器 助你快速搭建3D应用场景 WEBGPU VS. WEBGL 粗略地概述一下WebGPU与WebGL的不同之处是很有用的。在不涉及太多复杂的技术细节的情况下,两者的整体设计大致如下: WebGL和OpenGL一样,涉及许多单独的函数调…...
HTML <tfoot> 标签
实例 带有 thead、tbody 以及 tfoot 元素的 HTML 表格: <table border="1"><thead><tr><th>Month</th><th>Savings</th></tr></thead><tfoot><tr><td>Sum</td><td>$180<…...
VScode的PHP远程调试模式Xdebug
目录 第一步、安装VScode中相应插件 remote-ssh的原理 ssh插件: PHP相关插件: 第二步、安装对应PHP版本的xdebug 查看PHP具体配置信息的phpinfo页面 1、首先,打开php编辑器,新建一个php文件,例如:inde…...
HTML5-2-链接
HTML使用标签 <a>来设置超文本链接。 超链接可以是一个字,一个词,或者一组词,也可以是一幅图像,您可以点击这些内容来跳转到新的文档或者当前文档中的某个部分。 默认情况下,链接将以以下形式出现在浏览器中&am…...
Java--常用jar命令
jar常用指令 jar命令参数: jar命令格式:jar {c t x u f }[ v m e 0 M i ][-C 目录]文件名... 其中{ctxu}这四个参数必须选选其一。[v f m e 0 M i ]是可选参数,文件名也是必须的。 -c 创建一个jar包 -t 显示jar中的内容列表 -x 解压jar包 …...
微服务中间件--多级缓存
多级缓存 多级缓存a.JVM进程缓存1) Caffeine2) 案例 b.Lua语法1) 变量和循环2) 条件控制、函数 c.多级缓存1) 安装OpenResty2) 请求参数处理3) 查询Tomcat4) Redis缓存预热5) 查询Redis缓存6) Nginx本地缓存 d.缓存同步1) 数据同步策略2) 安装Canal2.a) 开启MySQL主从2.b) 安装…...
clickhouse系列3:clickhouse分析英国房产价格数据
1.准备数据集 该数据集包含有关英格兰和威尔士自1995年起到2023年的房地产价格的数据,超过2800万条记录,未压缩形式的数据集大小超过4GB,在ClickHouse中需要约306MB。 2.clickhouse中建表 CREATE TABLE uk_price_paid (price UInt32,...
2023京东口腔护理赛道行业数据分析(京东销售数据分析)
近年来,口腔护理逐渐成为年轻人重视的健康领域,从口腔护理整体市场来看,牙膏和牙刷等基础口腔护理产品仍占据主导地位。不过,随着口腔护理市场逐步朝向精致化、专业化、多元化等方向发展,不少新兴口腔护理产品受到消费…...
安服面试 --- 01
1、常用渗透工具 burp、nmap、sqlmap、蚁剑、御剑、冰蝎、cobalt strike等 2、渗透测试中,拿到目标公司站点,接下来应该怎么做? (1)信息收集:收集目标公司的相关信息。包括域名、ip地址、子域名、开放端…...
ExpressLRS开源之RC链路性能测试
ExpressLRS开源之RC链路性能测试 1. 源由2. 分析3. 测试方案4. 测试设计4.1 校准测试4.2 实验室测试4.3 拉距测试4.4 遮挡测试 5. 总结6. 参考资料 1. 源由 基于ExpressLRS开源基本调试验证方法,对RC链路性能进行简单的性能测试。 修改设计总能够满足合理的需求&a…...
el-form表单el-form-item prop一次验证两个值
1.表单添加两个框,prop写上 <el-form :model"ruleForm" :rules"rules" ref"ruleForm" label-width"100px" > <el-form-item type"type" label"时间" prop"dateSectOne"><di…...
HTTP 代理原理及 Python 简单实现
HTTP 代理是一种网络代理服务器(Proxy Server),它能够作为客户端与 HTTP 服务器之间的中介,它的工作原理是: 当客户端向 HTTP 代理发送 HTTP 请求时,HTTP 代理会收到请求。 HTTP 代理会将请求转发给目标 HTTP 服务器。 目标 HTTP 服务器处理请求并生成响应。 HTTP 代理将…...
数据结构--队列与循环队列
队列 队列是什么,先联想一下队,排队先来的人排前面先出,后来的人排后面后出;队列的性质也一样,先进队列的数据先出,后进队列的后出;就像图一的样子: 图1 如图1,1号元素是…...
八路参考文献:[八一新书]许少辉.乡村振兴战略下传统村落文化旅游设计[M]北京:中国建筑工业出版社,2022.
八路参考文献:[八一新书]许少辉.乡村振兴战略下传统村落文化旅游设计[M]北京:中国建筑工业出版社,2022....
版本控制 Git工具的使用
版本控制的概念: 版本控制(Revision control)是一种在开发的过程中用于管理我们对文件、目录或工程等内容的修改历史,方便查看更改历史记录,备份以便恢复以前的版本的软件工程技术。简单来说就是用于管理多人协同开发…...
GNS3 在 Linux 上的安装指南
文章目录 GNS3 在 Linux 上的安装指南1. 基于 Ubuntu 的发行版安装 GNS32. 基于 Debian 的安装3. 基于 ArchLinux 的安装4. 从 Pypi 安装 GNS35. 启动 GNS3 服务端GNS3 在 Linux 上的安装指南 大家好,今天我们来聊聊如何在 Linux 上安装 GNS3。GNS3 是一个非常受欢迎的网络模…...
Mybatis中 list.size() = 1 但显示 All elements are null
一、Bug展示 二、原因分析 2.1.情形一:Mybatis的XML中返回类型映射错误 <select id"selectByDesc" parameterType"com.task.bean.OrderInfo"resultType"com.task.bean.OrderInfo">select MER_ID,SETTLE_DATE,ICE_NAME,ORDER_S…...
MPNet:旋转机械轻量化故障诊断模型详解python代码复现
目录 一、问题背景与挑战 二、MPNet核心架构 2.1 多分支特征融合模块(MBFM) 2.2 残差注意力金字塔模块(RAPM) 2.2.1 空间金字塔注意力(SPA) 2.2.2 金字塔残差块(PRBlock) 2.3 分类器设计 三、关键技术突破 3.1 多尺度特征融合 3.2 轻量化设计策略 3.3 抗噪声…...
【网络安全产品大调研系列】2. 体验漏洞扫描
前言 2023 年漏洞扫描服务市场规模预计为 3.06(十亿美元)。漏洞扫描服务市场行业预计将从 2024 年的 3.48(十亿美元)增长到 2032 年的 9.54(十亿美元)。预测期内漏洞扫描服务市场 CAGR(增长率&…...
React Native在HarmonyOS 5.0阅读类应用开发中的实践
一、技术选型背景 随着HarmonyOS 5.0对Web兼容层的增强,React Native作为跨平台框架可通过重新编译ArkTS组件实现85%以上的代码复用率。阅读类应用具有UI复杂度低、数据流清晰的特点。 二、核心实现方案 1. 环境配置 (1)使用React Native…...
Nuxt.js 中的路由配置详解
Nuxt.js 通过其内置的路由系统简化了应用的路由配置,使得开发者可以轻松地管理页面导航和 URL 结构。路由配置主要涉及页面组件的组织、动态路由的设置以及路由元信息的配置。 自动路由生成 Nuxt.js 会根据 pages 目录下的文件结构自动生成路由配置。每个文件都会对…...
零基础设计模式——行为型模式 - 责任链模式
第四部分:行为型模式 - 责任链模式 (Chain of Responsibility Pattern) 欢迎来到行为型模式的学习!行为型模式关注对象之间的职责分配、算法封装和对象间的交互。我们将学习的第一个行为型模式是责任链模式。 核心思想:使多个对象都有机会处…...
Linux --进程控制
本文从以下五个方面来初步认识进程控制: 目录 进程创建 进程终止 进程等待 进程替换 模拟实现一个微型shell 进程创建 在Linux系统中我们可以在一个进程使用系统调用fork()来创建子进程,创建出来的进程就是子进程,原来的进程为父进程。…...
MySQL账号权限管理指南:安全创建账户与精细授权技巧
在MySQL数据库管理中,合理创建用户账号并分配精确权限是保障数据安全的核心环节。直接使用root账号进行所有操作不仅危险且难以审计操作行为。今天我们来全面解析MySQL账号创建与权限分配的专业方法。 一、为何需要创建独立账号? 最小权限原则…...
在QWebEngineView上实现鼠标、触摸等事件捕获的解决方案
这个问题我看其他博主也写了,要么要会员、要么写的乱七八糟。这里我整理一下,把问题说清楚并且给出代码,拿去用就行,照着葫芦画瓢。 问题 在继承QWebEngineView后,重写mousePressEvent或event函数无法捕获鼠标按下事…...
JS设计模式(4):观察者模式
JS设计模式(4):观察者模式 一、引入 在开发中,我们经常会遇到这样的场景:一个对象的状态变化需要自动通知其他对象,比如: 电商平台中,商品库存变化时需要通知所有订阅该商品的用户;新闻网站中࿰…...
LINUX 69 FTP 客服管理系统 man 5 /etc/vsftpd/vsftpd.conf
FTP 客服管理系统 实现kefu123登录,不允许匿名访问,kefu只能访问/data/kefu目录,不能查看其他目录 创建账号密码 useradd kefu echo 123|passwd -stdin kefu [rootcode caozx26420]# echo 123|passwd --stdin kefu 更改用户 kefu 的密码…...
