The built-in Life Preserver utility
Life Preserver is not the only way to make a backup. For example, you may find it easier to drag and drop the files/directories that you wish to backup to an external device, such as a USB drive, using one of the file manager utilities listed File Managers. You can also find a few PBIs of backup utilities using AppCafe®. The advantage of Life Preserver is that it allows you to easily schedule backups of your home directory to a backup server.
Managing Backups Using the GUI
An icon to the Life Preserver utility, seen in Figure 8.19a, can be found in the system tray. This icon is animated and will indicate when a backup is taking place.
To remove the icon from the system tray, right-click it. To re-add it to the tray,
Click the "+" button and select the name of the ZFS pool to backup. Unless you configured a custom pool name during installation, it will be tank. This will launch the the "New Life Preserver Wizard", allowing you to configure the backup schedule. Click "Next" to see the screen in Figure 8.19c:
This screen is used to schedule how often a snapshot is taken of the system. The default is to perform one snapshot per day at 1:00 AM. You can either change the time that this one daily snapshot occurs or select to take a snapshot once every hour, 30 minutes, 10 minutes or 5 minutes.
After making your selection, press "Next" to see the screen shown in Figure 8.19d.
This screen schedules how long to keep the created snapshots. By default, the last 7 days of snapshots are stored on the backup server. In other words, once a snapshot becomes older than 7 days, it is deleted on the backup server. You can select to either keep snapshots for so many days or to keep a certain quantity of snapshots.
After making your selection, press "Next" to see the screen shown in Figure 8.19e.
This screen is used to indicate which system to send the backups to. Click the "Replicate my data" box, then input the following information:
Host Name: of the remote system that will store your backup. If the backup server is on your local network, the host name must be in your hosts file or in the database of the local DNS server. You may find it easier to instead input the IP address of the backup server as this will eliminate any host name resolution problems.
User Name: this user must have permission to log in to the system that will hold the backup. If the account does not already exist, you should create it first on the backup server.
SSH Port: port 22, the default port used by SSH is selected for you. You only need to change this if the remote system is using a non-standard port to listen for SSH connections. In that case, use the up/down arrows or type in the port number.
Remote Dataset: input the name of an existing dataset on the backup server. This is where the backups will be stored. To get a list of existing datasets, type zfs list on the remote server. The "NAME" column in the output of that command gives the fullname of each dataset. Select one and type its fullname into this field. When selecting a dataset, make sure that the selected "User Name" has permission to write to the dataset.
if there is a firewall protecting the remote system, make sure that it allows connections to the specified port number from the IP address of the system that you wish to backup. If the backup server is running PC-BSD®, you can use Firewall Manager to add an entry for SSH.
Once you have input the information, click "Next" and then "Finish". Life Preserver will check that it can connect to the backup server. A pop-up message will remind you to save the SSH key to a USB stick (as described below) as this key is required should you even need to restore the operating system. It will then add an entry for the backup. Click the entry to activate its configuration buttons, as shown in Figure 8.19f.
These buttons, from left to right, allow you to:
Enable backups of a new dataset: this button will be greyed out if you only have one pool and have already scheduled a backup of the pool. Otherwise, it will start the "New Life Preserver Wizard" as described above.
Remove selected dataset from automatic backup: clicking this button will cancel the creation of snapshots and sending them to the backup server. This will remove the entry, meaning that you will have to go through the wizard again to re-enable backups of this pool.
Customize the backup configuration: this will open the screen shown in Figure 8.19g so that you can modify when the backups occur and how long they are stored on the backup server. If you click the "Replication" tab, you will see the screen shown in Figure 8.19h. This allows you to edit the connection information to the backup server. It also adds a "Frequency" option. By default, the backup occurs right after the snapshot is created. You can modify this so that the backup itself occurs at a set time, regardless of when the snapshots are created. For example, if you have configured snapshots to occur every 30 minutes but the replication frequency to occur daily at 2:00 AM, the 24 snapshots will remain on the PC-BSD system until 2:00 AM when they are copied over to the backup server.
If this is the first time using SSH to connect to this host, you will have to type yes to accept the RSA key fingerprint before being prompted to type in the password. If the connection is successful, the terminal will close and your new preserver will be listed in the main panel, shown in Figure 8.19g:
The entry contains the following information:
Backup Server: will indicate the user account and IP address of the backup server.
Last Backup: will indicate whether or not there is a last backup and if there is a successful backup, the time and date of that backup. If you chose to automate backups, the first backup will happen immediately. Otherwise, a backup will not occur until you press the "Start" button. How long the first backup takes depends upon the size of your home directory and the speed of your network. If the backup is unsuccessful, logs can be found in /usr/local/share/lifePreserver/preservers/<preserver_name>/logs/.explains the meaning of the various characters found in the logs.
Frequency: will indicate "disabled", "daily", or "weekly".
Status: Running… indicates that the backup is occurring now, otherwise it will show as Not running.
The backup will be stored on the remote system in the home directory of the user that was used by Life Preserver to login. The contents of the backup will be found in the life-preserver/<backup>/ subdirectory where <backup> is named according to the date and time stamp of the backup. The contents of the directory will mirror the directory structure of your home directory, making it very easy to find and restore individual files or directories from the backup server to your PC-BSD® system.
This screen allows you to configure the following:
Number of backups to keep: make sure that there is enough disk space on the backup server to store this amount of backups. If you do daily backups, a setting of 7 will keep a week's worth. If you do weekly backups, a setting of 4 or 5 will keep about a month's worth.
Remove incomplete or failed backups: by default, Life Preserver attempts to conserve disk space on the backup server by removing any failed backups. Uncheck this box if you are troubleshooting Life Preserver.
Disable automatic backups: if this is selected, a backup will only occur when you manually press the "Start" button.
Backup daily: if this is selected, a backup will occur once per day.
Backup weekly: if this is selected, a backup will occur once per week.
Remote directory: a subdirectory with the name you specify will be created in the home directory of the user that logs in to the SSH server. This is the location where backups will be stored. The default subdirectory name is life-preserver.
Modify include list: provides a graphical List Editor, seen in Figure 8.19i, for adding files/directories to include in the backup.
Modify exclude list: opens the List Editor in order to add the files/directories to exclude from backups.
When using List Editor, it will indicate whether or not you are editing the include or the exclude list. Use the browse button to select the files or directories that you wish to include or exclude. Alternately, you can type in a wildcard. For example, to select all files ending in the .txt extension, input *.txt.
Restoring a Backup
To restore files from a backup, right-click the preserver entry and select "Restore From". Life Preserver will query the backup server and show a list of available backups as seen in the example in Figure 8.19j:
When reading the backup name, the number before the "T" is the date in YYYY-MM-DD format and the number after the T is the date stamp in HH_MM_SS format. Highlight the backup you wish to restore and click the "Select Backup" button to open the window seen in Figure 8.19k:
If you wish to restore an individual file or directory, input its full path. In the example shown in Figure 8.19k, the user is restoring the directory /usr/home/dru/Documents--in other words, the Documents subfolder backed up from the home directory of the user named dru.
If you just input the name of the file or directory and click the "Restore" button, it will be restored to its original location and replace any files with the same name at that location.
If you instead check the "Restore Relative to specified directory" box, the selected file/directory will be restored to the location you specify.
Managing Backups From the Command Line
Backing Up to a FreeNAS System
Restoring the Operating System From a Life Preserver Backup