Open main menu

CDOT Wiki β

Changes

OPS335 Lab 1

1,018 bytes added, 15:10, 14 January 2017
Performing Incremental Backups =
== INVESTIGATION 3: PERFORMING & AUTOMATING BACKUPS ==
 
Data backups are considered to be an insurance policy. Running backup can be tedious, but they MUST be performed in an accurate and consistent basis, since loss of data can be expensive (For example: cost of hiring staff to re-enter data).
 
When performing labs or assignments in this class, if you fail to make backups and something bad occurs and there is loss of data, it only affects you. On the other hand, if you are supporting a client, or working for a company and fail to adequately perform backups and there is loss of data, then other users are affected by failure to backup essential data.
 
=== Performing Full Backups ===
 
A full backup is backup of all of the files on a system. Since it may take a long time, this backup is NOT performed on a daily basis.
In OPS235, you learned to use the '''gzip''', '''gunzip''', and '''virsh dumpxml''' / '''virsh define''' commands to backup your virtual machines and the '''tar''' command as an archiving tool.
In this lab, we will focus on a method expose you to the dump and restore utilities in order to provide automatic perform full backups of your VMs . You should be using this utility to perform full backups of all of your host machine as opposed VMs (both lab and assignment) prior to performing full and leaving your OPS335 lab session. '''Perform the following steps:''' #  === Performing Incremental Backups ===  An incremental backups (although it backup is recommended to study these techniques a backup of only files that have changed since they the last backup. In your case, it may be useful at some point in a later lab, and will be useful in later courses)good idea to perform incremental backups of your /etc/ directory for your VMs upon startup. We will now focus on be using the '''rsync ''' command to perform incremental backups for backing up our all of your VMs.
'''Rsync''' is a very versatile backup tool. As the name suggests, rsync is used for <u>synchronizing</u> files typically across a network. It works over the '''SSH''' protocol, which is useful in our situation since we are running ssh on our server and VMs. You are going to use your ''host machine'' to backup files from the ''virtual machines''.
<ol><li value="4">If rsync prompts for a password, make certain that you completed the '''SSH key''' section above, and that you assigned the keys for the <u>appropriate user</u><br>(in this case, for the '''root user for both the hostname and vm1'''!)</li><li>When the rsync command runs correctly, you should see all the files from vm1 being copied over to your host machine.</li><li>Run the rsync command again. Notice that the second time nothing is copied over to your host machine since none of the files have changed on your vm1 machine.</li><li>Create a new file in vm1's '''/etc/''' directory, and rerun '''rsync'''. Confirm on your '''host machine''' that only that file that was created on your vm1 machine actually got backed up to your host machine.</li><li>Repeat the above steps to create backups for your '''vm2''' and '''vm3''' machines on your host machine as well (for the respective directories: '''/backup/vm2''' and '''/backup/vm3''').</li></ol>
  === Scheduling Tasks with Cron Automating Backups (Automatic Backupscron) ===
'''Cron''' is a ''daemon'' (i.e. a program that runs in the background). The term ''"Cron"'' is short for '''Chronograph''' which was an old fashioned term for a '''stop watch''' or '''timer'''. The role of '''Cron''' is to run tasks periodically. It can run tasks for the system (as root) or for a user (including regular users).
13,420
edits