Rocky Linux 8 配置REAR实现灾难备份与恢复

REAR (RELAX-AND-RECOVER) 用于创建灾难恢复映像的工具,灾难恢复信息可通过MFS网络存储等也可以存储在USB等硬盘存储设备。


配置REAR进行备份

[root@DevOps ~]# cat /etc/rear/local.conf
# This file etc/rear/local.conf is intended for the user's
# manual configuration of Relax-and-Recover (ReaR).
# For configuration through packages and other automated means
# we recommend a separated file named site.conf next to this file
# and leave local.conf as is (ReaR upstream will never ship a site.conf).
# The default OUTPUT=ISO creates the ReaR rescue medium as ISO image.
# You need to specify your particular backup and restore method for your data
# as the default BACKUP=REQUESTRESTORE does not really do that (see "man rear").
# Configuration variables are documented in /usr/share/rear/conf/default.conf
# and the examples in /usr/share/rear/conf/examples/ can be used as templates.
# ReaR reads the configuration files via the bash builtin command 'source'
# so bash syntax like VARIABLE="value" (no spaces at '=') is mandatory.
# Because 'source' executes the content as bash scripts you can run commands
# within your configuration files, in particular commands to set different
# configuration values depending on certain conditions as you need like
# CONDITION_COMMAND && VARIABLE="special_value" || VARIABLE="usual_value"
# but that means CONDITION_COMMAND gets always executed when 'rear' is run
# so ensure nothing can go wrong if you run commands in configuration files.

ISO DIR=file:///mount_point
BACKUP_PROG=tar
BACKUP_TYPE=full
BACKUP=NETFS
BACKUP_URL=file:///mount_point
OUTPUT=ISO
OUTPUT_URL=file:///mount_point

# save in $hostname/2020-04-02T 15:32+02:00/ style directory
OWN_BACKUP_PREFIX="${HOSTNAME}-$(date '+%Y%m%d-%H%M')"
# save ISO image (base files) into OWN_BACKUP_PREFIX
OUTPUT_PREFIX="${OWN_BACKUP_PREFIX}"
# store tgz archive into OWN_BACKUP_PREFIX
NETFS_PREFIX="${OWN_BACKUP_PREFIX}"

# required programs for the rescue CD. Note that the program must be available or creating the CD will abort.
REQUIRED_PROGS=(
awk
base64
diff
dos2unix
lsblk
lsof
lspci
md5sum
mkfs.vfat
mkswap
mount
mount.cifs
mount.fuse
mount.lowntfs-3g
mount.ntfs
mount.ntfs-3g
ntfs-3g
ntfs-3g.probe
parted
ping
ping6
pstree
renice
rsync
screen
sha256sum
tmux
swapon
touch
vim
vimdiff
scp
#smbclient
ssh
sshfs
watch
chattr
lsattr
#ncurses-utils:
clear
infocmp
reset
tabs
toe
tput
tset
"${REQUIRED_PROGS[@]}"
)

配置REAR进行还原

RESCUEDevOps:~ # mkdir /mount_point && mount.ntfs-3g /dev/sdb1 /mount_point # 引导REAR所创建的ISO启动至恢复模式
RESCUE DevOps:~ # rear -d -v recover 
RESCUE DevOps:~ # reboot

参考资料:http://relax-and-recover.org/documentation/

上一篇
下一篇
/*
Theme Argon
*/