Date: Thursday, January 19, 2006
Due: Thursday, January 26, 2006
Running batch jobs (at and cron)
Running jobs in batch mode is one of the most basic elements of system administration. Unix and Linux systems are normally deployed in server-type settings where there is much activity on a 24/7 basis. In order to demonstrate proficiency with setting up batch jobs and running them at specified times in the future, you'll need to master the details of at and cron. You'll also need to acquire basic shell programming skills to define the tasks (i.e. shell scripts) to be performed at the specified times.
Read the man pages for at and cron and then read the shell scripting tutorial from www.linuxcommand.org/writing_shell_scripts.php (there is a link to this site on our course page http://www.msoe.edu/~blessing/ms373 ). When you're finished with the reading portion of the task, then you are ready to tackle the following assignment:
Using the man pages for the du, sort, and head commands as reference, write a shell script that determines which 3 directories under /usr are the largest on your system. (Hint: you'll want to use a reverse numeric sort in your work.) Schedule the script to run every Sunday night at midnight and have it email its output to you.
As always, a complete report that contains the steps you've written to solve this problem must be demonstrated and discussed in your report. If you have any questions about the content of the report, please ask during lab or in class (for everyone's benefit).