CSCI 257: Fundamental UNIX System Administration
Class Project for Spring 2003
The goal of the class project is to provide students with practical experience
to administer Linux installation and administration on a computer shared
with Windows.
Laboratory Assignment 5
ASSIGNMENT DUE: 12:00 NOON, March 12, 2003.
Assignment Description:
As a system administrator, you will need to schedule processes to run at
different times. This assignment will introduce you to some scheduling
facilities available on Linux.
Goal:
The goal of this assignment is to introduce students
to sleep, cron, anacron and at.
Objectives:
- Learn the format of the crontab file
- Learn how to schedule processes with cron
- Learn how to use sleep
- Learn how to schedule processes with at
- Write a script that will do something useful at a regular interval.
Expected Outcome:
- Write a script called clnet
- This script will remove some files from the .netscape directory
found in your home directory.
- TURNIN
- A printout of the clnet script
- A copy of this lab with answers
-
Use sleep to create a reminder that your pasta
is ready in ten minutes. (hint: String a couple of commands together).
$___________________________________________________________________________________
-
Create an at job that copies all files in your
home directory to /var/tmp at 1:30pm. You may
want to create a sub-directory in /var/tmp (use the recursive
option for cp and remember to use 24 hour time format).
$_______________________________________________________________________________________________
at>_____________________________________________________________________________________________
- anacron can be used to run commands periodically like
cron, it doesn't make an assumption that cron makes though
which can make it useful in some circumstances. What are those circumstances?
(read the man page for anacron)
_____________________________________________________________________________________
_____________________________________________________________________________________
- Write a crontab entry that will execute the command date
>> ~/datefile every minute. (View the file to make sure it
is working).
______________________________________________________________________________________
-
Write a crontab entry to run clnet (the script you are
about to write) every night sometime between 3 and 5am. Choose some
random minute in this time frame (you wouldn't want 100 different cron entries
to be run at exactly the same time).
_____________________________________________________________________________________
-
Where is your personal crontab file stored?_________________________________________________
(Not the file you created with a text editor but the one cron reads.
Read the man page for cron if necessary)
- Write a script called clnet
- This script is for cleaning up some files generated by netscape
and for removing netscapes lock file when necessary.
- On your ecst account if you use netscape very much you will eventually
fill up your disk quota with netscape cache. A script like clnet
could be used to clean out all of these files and could be scheduled to run
regularly with cron.
- When this script is run without any arguments it should delete:
- ~/.netscape/cookies
- ~/.netscape/history.list
- ~/.netscape/history.dat
- ~/.netscape/cache/* (all files and directories under the
cache directory)
- When this script is run with the single argument "lock" (as in
clnet lock ) this script should remove netscapes lock file but none of
the other files. Netscapes lock file is located at ~/.netscape/lock
and is used to prevent multiple instances of netscape from running at the
same time.
- If this script is called with any other options it should print
a usage message and exit without deleting any files.
- I recommend writing this script using bash but you can use
any of the following if you prefer sh, csh, tcsh,
ksh. or perl.
- To run the script you will need to have execute permission on it
and have it in your PATH (or give the relative path on the command
line, if it was in your current directory you could type ./clnet).
- Please include one line of documentation
- # clnet script for deleting netscapes cache, history and lock
file - written by YOUR NAME
- (You can document it more if it helps you but one line similar
to above is all I care about).
- Include a print out of this script with your turn-in, make sure
it works.