Lab exercises for Session 8: Day-to

Lab exercises for Session 8: Day-to-day Administration
1.
Install a package using the rpm command:
1.1. Find the acro read (Acrobat Reader) rpm on the instructor's computer and either
download it through ftp or cd to its directory after mounting the nfs share it's in. It is
located in /var/ f t p/pub/suse/9.0/suse/ i586
1.2. Install it:
# rpm -ivh acroreadversion.rpm
Hint: don't type the whole thing out.
Use the Force, Luke.... (aka the TAB key)
1.3. Verify that it's installed and working by typing acroread at a user prompt.
1.4. How do you make Acrobat Reader launch automatically when you double-click on a
PDF in your file manager? In your Web browser?
1.5. Extra credit: Why is this application included in SuSE's distribution but not in Fedora?
2.
Use the rpm command to find out what's installed on your system:
# rpm -qa
3.
Hint: you probably want to pipe this to more or less
Remove a package using the rpm command:
3.1. Find something useless in the list produced by the above exercise. Hint: pcmcia and
apmd are only useful on laptops.
3.2. Remove the package:
# rpm -e packagename
3.3. Rinse & repeat as necessary.
4.
Make a tarball of your configs:
4.1. Make an uncompressed tarball of /etc:
# cd /
# tar -cvf etc.tar /etc
While you're waiting for this to finish, look at the first part of the next exercise (process
control).
When it's finished: How big is the resulting file?
©2004 Ken Barber Some Rights Reserved
This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License. To view a
copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/1.0/ or send a letter to Creative Commons,
559 Nathan Abbott Way, Stanford, California 94305, USA.
4.2. Make a gzipped tarball of /etc:
# tar -czvf etc.tar.gz /etc
How big is the resulting file?
4.3. Make a bzipped tarball of /etc:
# cd /
# tar -cjvf etc.tar.bz2 /etc
How big is the resulting file?
4.4. Become a non-root user, cd to a directory where you have write permissions (such as
your home directory) and untar one of your tarballs.
$ tar -xvf /etc.tar
$ tar -zxvf /etc.tar.gz
$ tar -jxvf /etc.tar.bz2
(or)
(or)
tar will create a directory called etc under the current directory and extract
everything in there. Look around in there. What is missing, and why? (Hint: look for
grub.conf)
5.
Process Control: While the above exercises are running, run top in a separate terminal
session to watch your system resource usage. You might have to run the tar exercises
several times to see everything here.
5.1. Can you find the tar command in the list?
5.1.1. What percent of the processor's time is it using?
5.2. Press P (Upper-case) to sort top by processor usage. If tar is still running, can you find
it now?
5.3. What is tar's PID?
5.4. While tar is making one of the compressed tarballs, find bzip or gzip (depending
on which one you're using) and press r (lower case) to “renice” it. Notice that you'll
need the compression program's PID to do this. Give it a “nice” value of 20.
5.4.1. What does this do to the compression program's CPU usage?
5.4.2. What does it do to the amount of time it takes for tar to complete?
5.5. While tar is making one of the compressed tarballs, find bzip or gzip (depending
©2004 Ken Barber Some Rights Reserved
This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License. To view a
copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/1.0/ or send a letter to Creative Commons,
559 Nathan Abbott Way, Stanford, California 94305, USA.
on which one you're using) and press k (lower case) to kill it. Notice that you'll need
the compression program's PID to do this. When it asks for a signal, just press “Enter”.
5.5.1. Back in the shell where tar was running, what error message did you get?
6.
Write a script file to back up your /etc directory. Create a file and give it any name you
want. Remember where it's saved. Make it look like this:
#! /bin/sh
tar -czf /var/etc.tar.gz /etc
6.1. How do you make this file executable? (Hint: the answer was covered in session 4)
Make it so, and run it to make sure it works. Notice that the -v was left out of the tar
command in this script. What effect does this cause?
7.
If the lecture hasn't started yet, read the man page to cron.daily and try to figure out
how to run your backup script automatically every night. If you figure it out, go ahead and
edit cron.daily to make it so.
©2004 Ken Barber Some Rights Reserved
This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License. To view a
copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/1.0/ or send a letter to Creative Commons,
559 Nathan Abbott Way, Stanford, California 94305, USA.