26.2. Integrating ReaR with Backup Software
26.2.1. The Built-in Backup Method
- a rescue system and a full-system backup can be created using a single
rear mkbackupcommand - the rescue system restores files from the backup automatically
26.2.1.1. Configuring the Internal Backup Method
/etc/rear/local.conf:
BACKUP=NETFS BACKUP_URL=backup location
tar command. 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 26.4. Adding tar Backups
/srv/backup/ directory:
OUTPUT=ISO OUTPUT_URL=file:///mnt/rescue_system/ BACKUP=NETFS BACKUP_URL=file:///srv/backup/
- To keep old backup archives when new ones are created, add this line:
NETFS_KEEP_OLD_BACKUP_COPY=y
- 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=incremental
This automatically setsNETFS_KEEP_OLD_BACKUP_COPYtoy. - 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_URLdirective toiso:///backup/: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.Example 26.5. Configuring Single-ISO Rescue System and Backups
This configuration creates a rescue system and a backup file as a single ISO image and puts it into the/srv/backup/directory:OUTPUT=ISO OUTPUT_URL=file:///srv/backup/ BACKUP=NETFS BACKUP_URL=iso:///backup/
Note
The ISO image might be large in this scenario. Therefore, Red Hat recommends creating only one ISO image, not two. For details, see the section called “ISO-specific Configuration”. - To use
rsyncinstead oftar, add this line:BACKUP_PROG=rsync
Note that incremental backups are only supported when usingtar.
26.2.1.2. Creating a Backup Using the Internal Backup Method
BACKUP=NETFS set, ReaR can create either a rescue system, a backup file, or both.
- To create a rescue system only, run:
rear mkrescue
- To create a backup only, run:
rear mkbackuponly
- To create a rescue system and a backup, run:
rear mkbackup
Note
BACKUP=NETFS setting 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 rear recover.
~]# rear checklayout ~]# echo $?
Important
rear checklayout command 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 26.6. Using rear checklayout
~]# rear checklayout || rear mkrescue26.2.2. Supported Backup Methods
26.2.3. Unsupported Backup Methods
- The rescue system prompts the user to manually restore the files. This scenario is the one described in "Basic ReaR Usage", except for the backup file format, which may take a different form than a tar archive.
- ReaR executes the custom commands provided by the user. To configure this, set the
BACKUPdirective toEXTERNAL. Then specify the commands to be run during backing up and restoration using theEXTERNAL_BACKUPandEXTERNAL_RESTOREdirectives. Optionally, also specify theEXTERNAL_IGNORE_ERRORSandEXTERNAL_CHECKdirectives. See/usr/share/rear/conf/default.conffor an example configuration.
26.2.4. Creating Multiple Backups
BACKUP=NETFS(internal method)BACKUP=BORG(external method)
-C option of the rear command. The argument is a basename of the additional backup configuration file in the /etc/rear/ directory. The method, destination, and the options for each specific backup are defined in the specific configuration file, not in the main configuration file.
Procedure 26.1. Basic recovery of the system
- Create the ReaR recovery system ISO image together with a backup of the files of the basic system:
~]#
rear -C basic_system mkbackup - Back the files up in the
/homedirectories:~]#
rear -C home_backup mkbackuponly
/boot, /root, and /usr.
Procedure 26.2. Recovery of the system in the rear recovery shell
~]#
rear -C basic_system recover~]#
rear -C home_backup restoreonly

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.