0%
简介
实体机器没办法做快照,就必须做好备份和恢复工作。
1 2 3 4
| yum -y install dump
dump restore
|
dump

增量备份

案例:备份“分区”
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
| lsblk
dump -0uj -f /opt/fourth_division_backup.bak0.bz2 /fourth_division
dump -1uj -f /opt/fourth_division_backup.bak1.bz2 /fourth_division
cat /etc/dumpdates
|
案例:备份文件夹、文件
1 2 3
| dump -0j -f /opt/fourth_division_newonefiles_backup.bak0.bz2 /fourth_division/newone
|
restore

案例:比较不同
1 2 3 4 5 6 7 8 9 10
| mv ./hello.txt ./byebye.txt
restore -C -f fourth_division_newonefiles_backup.bak0.bz2
restore: unable to stat ./newone/hello.txt: No such file or directory Some files were modified! 4 compare errors
|
案例:查看备份文件内部有什么
1
| restore -t -f fourth_division_newonefiles_backup.bak0.bz2
|

案例:按顺序依次恢复
1 2 3 4 5 6 7 8
| cd /opt mkdir restore_tmp cd restore_tmp
restore -r -f /opt/fourth.bak0.bz2 restore -r -f /opt/fourth.bak1.bz2 restore -r -f /opt/fourth.bak2.bz2
|