Difference between revisions of "Life Preserver/9.2"

From PC-BSD Wiki
Jump to: navigation, search
m (Reverted edits by Vater (talk) to last revision by Drulavigne)
(37 intermediate revisions by 4 users not shown)
Line 1: Line 1:
<noinclude>{{NavHeader|back=Bluetooth Manager|forward=Warden®}}</noinclude>
+
<noinclude>{{NavHeader|back=Adobe Flash Player preferences|forward=Warden®}}</noinclude>
The built-in Life Preserver utility allows you to automate backups of your home directory. Backups are stored on a remote system; for the purposes of this section, we'll refer to the remote system as a backup server. Life Preserver uses SSH and rsync, meaning that the backup server must have SSH and rsync installed. If the backup server is another PC-BSD system, these are already installed and configured for you. If the remote system is running another operating system, you will have to ensure that SSH and rsync are installed and that SSH is listening for connections. Regardless of the operating system on the backup server, you will need to open TCP ports 22 and 873 using the firewall software installed on the backup server.
+
  
'''NOTE:''' you can also use [http://www.freenas.org FreeNAS], an open source NAS solution based on FreeBSD, as the backup server. Instructions for configuring FreeNAS to accept Life Preserver backups can be found in the [http://bsdmag.org/magazine/1756-protecting-dynamic-websites-in-freebsd September 2011 issue] of BSD Magazine.
+
The built-in Life Preserver utility allows you to automate backups of ''/usr/home/'' which contains the home directory for each user account created on the PC-BSD® system. Backups are stored on a remote system; for the purposes of this section, we will refer to the remote system as a backup server. Life Preserver uses SSH and rsync, meaning that the backup server must have SSH and rsync installed. If the backup server is another PC-BSD® system, these are already installed and configured for you. If the remote system is running another operating system, you will have to ensure that SSH and rsync are installed and that SSH is listening for connections. Regardless of the operating system on the backup server, you will need to open TCP ports 22 and 873 using the firewall software installed on the backup server.
  
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 [[Files_and_File_Sharing#File_Managers and File Structure | File Managers]]. You'll 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.
+
'''NOTE:''' you can also use {{citelink|url=http://www.freenas.org|txt=FreeNAS®}}, an open source NAS solution based on FreeBSD, as the backup server. Instructions for configuring FreeNAS® to accept Life Preserver backups can be found in the {{citelink|url=http://bsdmag.org/magazine/1756-protecting-dynamic-websites-in-freebsd|txt=September 2011 issue}} of BSD Magazine.
  
===Creating a Backup===
+
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 [[Files and File Sharing#File Managers and File Structure | 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.
  
A shortcut to the Life Preserver utility, seen in Figure 7.9a, can be found in your system tray. This icon is animated and will indicate when a backup is taking place.
+
=== Creating a Backup Schedule ===
  
'''Figure 7.9a: Life Preserver Icon in System Tray'''
+
A shortcut to the Life Preserver utility, seen in Figure 8.18a, can be found in the system tray. This icon is animated and will indicate when a backup is taking place.
 +
 
 +
'''Figure 8.18a: Life Preserver Icon in System Tray'''
  
 
[[File:Lifepreserver.png]]
 
[[File:Lifepreserver.png]]
  
If you right-click the icon, the menu provides options to minimize (if the Life Preserver window is open), to perform a restore (if a backup exists), to start Life Preserver whenever the current user logs in, or to quit (remove the icon from the tray).  
+
If you right-click the icon, the menu provides options to minimize (if the Life Preserver window is open), to perform a restore (if a backup exists), to start Life Preserver whenever the current user logs in, or to quit (remove the icon from the tray).
  
To start the backup wizard shown in Figure 7.9b, double-click the icon, or click Control Panel ➜ Life Preserver, or type '''life-preserver''' at the command line.
+
To start the backup wizard shown in Figure 8.18b, double-click the icon, or click ''[[Control Panel]]'' ''[[Life Preserver]]'', or type '''life-preserver''' at the command line.
  
'''Figure 7.9b: Life Preserver Welcome Screen'''
+
'''Figure 8.18b: Life Preserver Welcome Screen'''
  
 
[[Image:Preserver1b.png]]
 
[[Image:Preserver1b.png]]
  
Once you click the Get Started button, the Add New Life Preserver Wizard will launch, allowing you to configure a backup. Click Next to see the screen in Figure 7.9c:
+
Once you click the "Get Started" button, the "Add New Life Preserver Wizard" will launch, allowing you to configure a backup. Click "Next" to see the screen in Figure 8.18c:
  
'''Figure 7.9c: Remote Device Configuration Screen'''
+
'''Figure 8.18c: Remote Device Configuration Screen'''
  
[[Image:Preserver1c.png]]
+
[[Image:Preserver1d.png]]
  
 
You will need to input the following information:
 
You will need to input the following information:
Line 36: Line 37:
 
'''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.
 
'''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.
  
'''Note:''' 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.
+
'''NOTE:''' 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 click the Next button, you can decide whether or not to schedule regular backups, as seen in Figure 7.9d:
+
Once you click the "Next" button, you can decide whether or not to schedule regular backups, as seen in Figure 8.18d:
  
'''Figure 7.9d: Selection Screen to Automate Backups and Determine Their Frequency'''
+
'''Figure 8.18d: Selection Screen to Automate Backups and Determine Their Frequency'''
  
[[Image:Preserver2b.png]]
+
[[Image:Preserver2c.png]]
  
By default, automatic backups are disabled, meaning you will have to manually start a backup when you wish to do so. If you decide to automate backups, you can choose to backup daily or weekly. After making your selection, click Next and you will see the informational message in Figure 7.9e:
+
By default, automatic backups are disabled, meaning you will have to manually start a backup when you wish to do so. If you decide to automate backups, you can choose to backup daily or weekly. After making your selection, click "Next" and you will see the informational message in Figure 8.18e:
  
'''Figure 7.9e: Life Preserver is Now Ready to Test the Connection to the SSH Server'''
+
'''Figure 8.18e: Life Preserver is Now Ready to Test the Connection to the SSH Server'''
  
 
[[Image:Preserver3.png]]
 
[[Image:Preserver3.png]]
  
Click the Finish button and a terminal will open where you can enter the password for the user account you specified, as seen in Figure 7.9f:
+
Click the "Finish" button and a terminal will open where you can enter the password for the user account you specified, as seen in the example in Figure 8.18f:
  
'''Figure 7.9f: Logging into the SSH Server'''
+
'''Figure 8.18f: Logging into the SSH Server'''
  
 
[[Image:Preserver4.png]]
 
[[Image:Preserver4.png]]
  
If this is the first time you have ssh'd 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 7.9g:  
+
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.18g:
  
'''Figure 7.9g: Life Preserver Shows a New Preserver'''
+
'''Figure 8.18g: Life Preserver Shows a New Preserver'''
  
[[File:Preserver5.png]]
+
[[File:Preserver5a.png]]
  
The entry contains the following information:  
+
The entry contains the following information:
  
'''Preserver Name:''' will indicate the user account and IP address of the backup server.
+
'''Backup Server:''' will indicate the user account and IP address of the backup server.
  
'''Last Backup:''' will indicate whether or not the last backup was successful. 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.
+
'''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/''. {{citelink|url=http://stackoverflow.com/questions/4493525/rsync-what-means-the-f-on-rsync-logs|txt=This post}} explains the meaning of the various characters found in the logs.
  
'''Frequency:''' will indicate disabled, daily, or weekly.
+
'''Frequency:''' will indicate "disabled", "daily", or "weekly".
  
'''Status:''' running indicates that the backup is occurring now, otherwise will show as not running.
+
'''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.
+
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.
  
===Configuration Options===
+
=== Configuration Options ===
  
If you right-click a preserver and select Edit, you will see the configuration screen shown in Figure 7.9h.
+
If you right-click a preserver and select "Edit", you will see the configuration screen shown in Figure 8.18h.
  
'''Figure 7.9h: Life Preserver Configuration Options
+
'''Figure 8.18h: Life Preserver Configuration Options
  
[[File:Preserver6a.png]]
+
[[File:Preserver6b.png]]
  
 
This screen allows you to configure the following:
 
This screen allows you to configure the following:
Line 88: Line 89:
 
'''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.<noinclude>[[category:troubleshooting]]</noinclude><!-- This category tag causes this page to be included -for referencing this topic -->
 
'''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.<noinclude>[[category:troubleshooting]]</noinclude><!-- This category tag causes this page to be included -for referencing this topic -->
  
'''Disable automatic backups:''' if this is selected, a backup will only occur when you manually press the Start button.
+
'''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 daily:''' if this is selected, a backup will occur once per day.
  
'''Backup weekly:''' if this is selected, a backup will occur on the day of the week you select.
+
'''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 where backups will be stored. The default subdirectory name is ''life-preserver''.
+
'''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 interface for adding files/directories to include in the backup. Clicking this button will open the List Editor seen in Figure 7.9i:
+
'''Modify include list:''' provides a graphical List Editor, seen in Figure 8.18i, for adding files/directories to include in the backup.
  
'''Modify exclude list:''' opens the List Editor for adding files/directories to exclude from backups.  
+
'''Modify exclude list:''' opens the List Editor in order to add the files/directories to exclude from backups.
  
'''Figure 7.9i: Adding Entries to the Include List'''
+
'''Figure 8.18i: Using List Editor to Modify the Include List'''
  
[[File:Preserver7a.png]]
+
[[File:Preserver7b.png]]
  
When using List Editor, be sure to type the full pathname to the file or directory that you wish to include or exclude from the backup.
+
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===
+
=== 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 7.9j:
+
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.18j:
  
'''Figure 7.9j: Selecting a Backup from the List of Available Backups'''
+
'''Figure 8.18j: Selecting a Backup from the List of Available Backups'''
  
[[File:Preserver8.png]]
+
[[File:Preserver8a.png]]
  
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 7.9k:
+
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.17k:
  
'''Figure 7.9k: Selecting the Files to Restore'''
+
'''Figure 8.18k: Selecting the Files to Restore'''
  
[[File:Preserver9a.jpeg]]
+
[[File:Preserver9a.png]]
  
If you wish to restore an individual file or directory, input its full path. In the example shown in Figure 7.9k, 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 wish to restore an individual file or directory, input its full path. In the example shown in Figure 8.18k, 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 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.
 
If you instead check the "Restore Relative to specified directory" box, the selected file/directory will be restored to the location you specify.
 +
 +
<noinclude>{{refheading}}</noinclude>
 
<noinclude>
 
<noinclude>
 
[[category:handbook]]
 
[[category:handbook]]

Revision as of 13:17, 29 November 2012

(Sorry for the inconvenience)

Contents

The built-in Life Preserver utility allows you to automate backups of /usr/home/ which contains the home directory for each user account created on the PC-BSD® system. Backups are stored on a remote system; for the purposes of this section, we will refer to the remote system as a backup server. Life Preserver uses SSH and rsync, meaning that the backup server must have SSH and rsync installed. If the backup server is another PC-BSD® system, these are already installed and configured for you. If the remote system is running another operating system, you will have to ensure that SSH and rsync are installed and that SSH is listening for connections. Regardless of the operating system on the backup server, you will need to open TCP ports 22 and 873 using the firewall software installed on the backup server.

NOTE: you can also use FreeNAS®[1], an open source NAS solution based on FreeBSD, as the backup server. Instructions for configuring FreeNAS® to accept Life Preserver backups can be found in the September 2011 issue[2] of BSD Magazine.

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.

Creating a Backup Schedule

A shortcut to the Life Preserver utility, seen in Figure 8.18a, can be found in the system tray. This icon is animated and will indicate when a backup is taking place.

Figure 8.18a: Life Preserver Icon in System Tray

Lifepreserver.png

If you right-click the icon, the menu provides options to minimize (if the Life Preserver window is open), to perform a restore (if a backup exists), to start Life Preserver whenever the current user logs in, or to quit (remove the icon from the tray).

To start the backup wizard shown in Figure 8.18b, double-click the icon, or click Control PanelLife Preserver, or type life-preserver at the command line.

Figure 8.18b: Life Preserver Welcome Screen

Preserver1b.png

Once you click the "Get Started" button, the "Add New Life Preserver Wizard" will launch, allowing you to configure a backup. Click "Next" to see the screen in Figure 8.18c:

Figure 8.18c: Remote Device Configuration Screen

Preserver1d.png

You will need to 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.

NOTE: 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 click the "Next" button, you can decide whether or not to schedule regular backups, as seen in Figure 8.18d:

Figure 8.18d: Selection Screen to Automate Backups and Determine Their Frequency

Preserver2c.png

By default, automatic backups are disabled, meaning you will have to manually start a backup when you wish to do so. If you decide to automate backups, you can choose to backup daily or weekly. After making your selection, click "Next" and you will see the informational message in Figure 8.18e:

Figure 8.18e: Life Preserver is Now Ready to Test the Connection to the SSH Server

Preserver3.png

Click the "Finish" button and a terminal will open where you can enter the password for the user account you specified, as seen in the example in Figure 8.18f:

Figure 8.18f: Logging into the SSH Server

Preserver4.png

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.18g:

Figure 8.18g: Life Preserver Shows a New Preserver

Preserver5a.png

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/. This post[3] 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.

Configuration Options

If you right-click a preserver and select "Edit", you will see the configuration screen shown in Figure 8.18h.

Figure 8.18h: Life Preserver Configuration Options

Preserver6b.png

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.18i, 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.

Figure 8.18i: Using List Editor to Modify the Include List

Preserver7b.png

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.18j:

Figure 8.18j: Selecting a Backup from the List of Available Backups

Preserver8a.png

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.17k:

Figure 8.18k: Selecting the Files to Restore

Preserver9a.png

If you wish to restore an individual file or directory, input its full path. In the example shown in Figure 8.18k, 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.

References


  1. http://www.freenas.org
  2. http://bsdmag.org/magazine/1756-protecting-dynamic-websites-in-freebsd
  3. http://stackoverflow.com/questions/4493525/rsync-what-means-the-f-on-rsync-logs