This shows you the differences between two versions of the page.
|
linux:backup_rear [2021/01/01 21:25] 127.0.0.1 external edit |
linux:backup_rear [2021/11/04 11:53] (current) manu |
||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== Backup all linux servers on a central server ====== | ====== Backup all linux servers on a central server ====== | ||
| - | REAR is an utility to install on Linux server (package: rear). With this tool, you can backup your OS, and more... | + | Packages also available for linux x84_64, ppc64 and ppc64le |
| - | Configure the client to be able to backup on a nfs server | + | [[http://relax-and-recover.org/]] |
| - | <cli prompt='#'> | + | |
| - | [root@linux1 rear]# cat site.conf | + | REAR will generate a bootable iso file (minimum image <100M), to recover your system, and a compressed tar file containing all other data. |
| + | |||
| + | First install rear and dependencies: | ||
| + | <cli prompt='$'> | ||
| + | [root@rhlab1 ~]$ yum -y install mkisofs genisoimage attr bind-utils rear | ||
| + | </cli> | ||
| + | |||
| + | Configure rear using a NFS v4 mount point on nfssrv: | ||
| + | |||
| + | <cli prompt='$'> | ||
| + | [root@rhlab1 ~]$ cat /etc/rear/local.conf | ||
| + | # Default is to create Relax-and-Recover rescue media as ISO image | ||
| + | # set OUTPUT to change that | ||
| + | # set BACKUP to activate an automated (backup and) restore of your data | ||
| + | # Possible configuration values can be found in /usr/share/rear/conf/default.conf | ||
| + | # | ||
| + | # This file (local.conf) is intended for manual configuration. For configuration | ||
| + | # through packages and other automated means we recommend creating a new | ||
| + | # file named site.conf next to this file and to leave the local.conf as it is. | ||
| + | # Our packages will never ship with a site.conf. | ||
| OUTPUT=ISO | OUTPUT=ISO | ||
| BACKUP=NETFS | BACKUP=NETFS | ||
| - | BACKUP_URL="nfs://aixsrv1/export/rear/" | + | BACKUP_URL=nfs://nfssrv/export/backup/linux |
| - | REAR_INITRD_COMPRESSION="lzma" | + | # |
| - | AUTOEXCLUDE_MULTIPATH=N | + | ONLY_INCLUDE_VG=( ca ) |
| - | AUTOEXCLUDE_DISKS=Y | + | EXCLUDE_MOUNTPOINTS=( /data ) |
| + | BACKUP_PROG_EXCLUDE=( '/tmp/*' ) | ||
| </cli> | </cli> | ||
| + | |||
| + | Test a backup using validation on each step: | ||
| + | <cli prompt='$'> | ||
| + | [root@rhlab1 output]$ rear -v -d -S -c /etc/rear mkbackup | ||
| + | Relax-and-Recover 1.17.2 / Git | ||
| + | Using log file: /var/log/rear/rear-rhldapr1.log | ||
| + | Press ENTER to include '/etc/rear/os.conf' ... | ||
| + | Press ENTER to include '/usr/share/rear/conf/Linux-ppc64le.conf' ... | ||
| + | Press ENTER to include '/usr/share/rear/conf/GNU/Linux.conf' ... | ||
| + | Press ENTER to include '/etc/rear/local.conf' ... | ||
| + | Press ENTER to include '/usr/share/rear/init/default/01_set_drlm_env.sh' ... | ||
| + | .... | ||
| + | </cli> | ||
| + | For production backup use, remove validation option and or verbose and debug: | ||
| + | <cli prompt='$'> | ||
| + | $ rear -v -d -c /etc/rear mkbackup | ||
| + | </cli> | ||
| + | Rear supports also most backup software like Bacula, TSM… A full sample config file is located in **/usr/share/rear/conf/default.conf** | ||
| + | |||
| + | Sample config file using TSM (dsm.opt and dsm.sys must be register): | ||
| + | <cli prompt='$'> | ||
| + | [root@rhlab1 output]$ cat /etc/rear/local.conf | ||
| + | OUTPUT=ISO | ||
| + | #BACKUP=NETFS | ||
| + | #BACKUP_URL=nfs://systemh/export/backup/linux | ||
| + | # | ||
| + | ONLY_INCLUDE_VG=( ca ) | ||
| + | EXCLUDE_MOUNTPOINTS=( /data ) | ||
| + | # | ||
| + | BACKUP=TSM | ||
| + | COPY_AS_IS_TSM=( /etc/adsm/TSM.PWD /opt/tivoli/tsm/client /usr/local/ibm/gsk8* ) | ||
| + | COPY_AS_IS_EXCLUDE_TSM=( ) | ||
| + | PROGS_TSM=(dsmc) | ||
| + | # Should the result from mkrecover/backup saved via TSM | ||
| + | TSM_RESULT_SAVE=y | ||
| + | # TSM archive management class definition | ||
| + | TSM_ARCHIVE_MGMT_CLASS= | ||
| + | # if TSM server confirms the backup was successful (to preserve space on the local system) | ||
| + | TSM_RM_ISOFILE=y | ||
| + | # where to copy the resulting files to and save them with TSM | ||
| + | TSM_RESULT_FILE_PATH=/opt/tivoli/tsm/rear | ||
| + | </cli> | ||
| + | |||
| + | To exclude specific folders or files add the following line into the config file | ||
| + | <code> | ||
| + | BACKUP_PROG_EXCLUDE=( ${BACKUP_PROG_EXCLUDE[@]} '/var/www/html/*' '/software/*' '/repo/*') | ||
| + | </code> | ||
| On AIX server (or linux), configure NFSv4 | On AIX server (or linux), configure NFSv4 | ||