Open main menu

CDOT Wiki β

Changes

OPS335 Lab 1

91 bytes removed, 08:41, 18 January 2017
no edit summary
#Create the sub-directory '''/root/bin'''
#Create a Bash shell script called '''/root/bin/mybackupfullbackup.bash''' that will backup all of your other vms (i.e. vm1, vm2, and vm3) one at a time using the '''gzip''' command into the respective path-names: '''/backup/full/vm1''', '''/backup/full/vm2''', and '''/backup/full/vm'''
#Set execute permissions, and run the shell script to verify that you shell script works.
It will be your responsibility as an administrator of your own Linux system, to backup all of your VMs for labs and assignments at the end of your lab session. Learning to create shell scripts to automate routine tasks (such as backups) will be EXTREMELY useful for your NDD430 course.
 
=== Performing Incremental Backups ===
<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/incremental/vm2''' and '''/backup/incremental/vm3''').</li></ol>
 
=== Automating Backups (cron) ===
 
 
<pre>10 * * * * echo "Cron ran this job at: "`date` >> /tmp/cron.log</pre>
 
This tells cron to run the command '''echo "Cron ran this job at: "`date` > /tmp/cron.log''' at the 10th minute of every hour of every day of every month.
'''Perform the following steps:'''
{{Admon/important |Backup your VMs!|You MUST perform a '''full backup''' of ALL of your VMs whenever you complete your '''OPS335 labs''' or when working on your '''OPS335 assignments'''. You should be using the dump command, and you should use the Bash shell script that you were adviced to create in order to backup all of your VMs.}}
 
'''Record steps, commands, and your observations in INVESTIGATION 2 in your OPS335 lab log-book'''
 
== COMPLETING THE LAB ==
::<span style="color:green;font-size:1.5em;">&#x2713;</span> Each of your VMs should have an SSH server running.
::<span style="color:green;font-size:1.5em;">&#x2713;</span> should be able to ssh from your host to each VM as the root user without a password.
::<span style="color:green;font-size:1.5em;">&#x2713;</span> Display contents of backup script called: '''/root/bin/fullbackup.bash'''
::<span style="color:green;font-size:1.5em;">&#x2713;</span> FULL and INCREMENTAL backups of your 3 VMs.
::<span style="color:green;font-size:1.5em;">&#x2713;</span> You have notes in your labbook lab-book about what you've learned in this lab.
::<span style="color:green;font-size:1.5em;">&#x2713;</span> Run a shell script to submit your lab:<br>
:::'''Steps:'''
13,420
edits