Show Table of Contents
34.2. Integrating ReaR with Backup Software
The main purpose of ReaR is to produce a rescue system, but it can also be integrated with backup software. What integration means is different for the built-in, supported, and unsupported backup methods.
34.2.1. The Built-in Backup Method
ReaR ships with a built-in, or internal, backup method. This method is fully integrated with ReaR, which has these advantages:
- a rescue system and a full-system backup can be created using a single
- the rescue system restores files from the backup automatically
As a result, ReaR can cover the whole process of creating both the rescue system and the full-system backup.
188.8.131.52. Configuring the Internal Backup Method
To make ReaR use its internal backup method, add these lines to
BACKUP=NETFS BACKUP_URL=backup location
These lines configure ReaR to create an archive with a full-system backup using the
tarcommand. Substitute backup location with one of the options from the "Backup Software Integration" section of the rear(8) man page. Make sure that the backup location has enough space.
Example 34.4. Adding tar Backups
To expand the example in Section 34.1, “Basic ReaR Usage”, configure ReaR to also output a tar full-system backup into the
OUTPUT=ISO OUTPUT_URL=file:///mnt/rescue_system/ BACKUP=NETFS BACKUP_URL=file:///srv/backup/
The internal backup method allows further configuration.
- To keep old backup archives when new ones are created, add this line:
- By default, ReaR creates a full backup on each run. To make the backups incremental, meaning that only the changed files are backed up on each run, add this line:
BACKUP_TYPE=incrementalThis automatically sets
- To ensure that a full backup is done regularly in addition to incremental backups, add this line:
FULLBACKUPDAY="Day"Substitute "Day" with one of the "Mon", "Tue", "Wed", "Thu". "Fri", "Sat", "Sun".
- ReaR can also include both the rescue system and the backup in the ISO image. To achieve this, set the
BACKUP_URL=iso:///backup/This is the simplest method of full-system backup, because the rescue system does not need the user to fetch the backup during recovery. However, it needs more storage. Also, single-ISO backups cannot be incremental.
NoteCurrently ReaR creates two copies of the ISO image, thus consuming two times more storage. For more information, see note ReaR creates two ISO images instead of one in Red Hat Enterprise Linux 6 Release Notes.
Example 34.5. Configuring Single-ISO Rescue System and BackupsThis configuration creates a rescue system and a backup file as a single ISO image and puts it into the
OUTPUT=ISO OUTPUT_URL=file:///srv/backup/ BACKUP=NETFS BACKUP_URL=iso:///backup/
- To use
tar, add this line:
BACKUP_PROG=rsyncNote that incremental backups are only supported when using
184.108.40.206. Creating a Backup Using the Internal Backup Method
BACKUP=NETFSset, ReaR can create either a rescue system, a backup file, or both.
- To create a rescue system only, run:
- To create a backup only, run:
- To create a rescue system and a backup, run:
Note that triggering backup with ReaR is only possible if using the NETFS method. ReaR cannot trigger other backup methods.
When restoring, the rescue system created with the
BACKUP=NETFSsetting expects the backup to be present before executing
rear recover. Hence, once the rescue system boots, copy the backup file into the directory specified in
BACKUP_URL, unless using a single ISO image. Only then run
To avoid recreating the rescue system unnecessarily, you can check whether storage layout has changed since the last rescue system was created using these commands:
~]# rear checklayout ~]# echo $?
Non-zero status indicates a change in disk layout. Non-zero status is also returned if ReaR configuration has changed.
rear checklayoutcommand does not check whether a rescue system is currently present in the output location, and can return 0 even if it is not there. So it does not guarantee that a rescue system is available, only that the layout has not changed since the last rescue system has been created.
Example 34.6. Using rear checklayout
To create a rescue system, but only if the layout has changed, use this command:
rear checklayout || rear mkrescue