Chapter 11


1.

Create a crontab entry to record the system load averages to a log file every 15 minutes, but only on Monday through Friday, from 8:00 a.m. to 6:00 p.m. Hint: Take a look at the following online resource to learn more about the crontab format: http://www.opengroup.org/onlinepubs/007908799/xcu/crontab.html .

if you came up with the following crontab entry, you are absolutely correct: # min hourdaymonweekdaycommand*/1508-18 **01-05/usr/bin/uptime -- /var/log/load.log

2.

Search the System Log file from the command line for other possible problems, such as warnings, errors, and failures.

use the extended form of grep , or egrep , to specify a regular expression that will search for a number of errors in one fell swoop: # grep -ei 'failwarningerrorbadrefused' /var/log/messages of course, you could have split this command into five separate commands, such as: # grep -i fail/var/log/messages # grep -i warning /var/log/messages ... but using the regular expression allows you to get an aggregate listing of possible issues. you can learn more about regular expressions in chapter 13 .

3.

Modify syslog.conf to log FTP- related messages to another file, such as /var/log/ftp.log . Hint: Each entry in syslog.conf has three separate components : the messages to be considered , the destination, and any user -defined comments.

this one is easy to solve; it can be done with one line: ftp.* /var/log/ftp.log## log ftp messages

4.

Find all compressed tar archives within the /usr/local directory hierarchy and archive them to an ISO image so you can burn them to a CD-ROM and then delete them to free up disk space.

you can accomplish this task in a number of ways. two approaches are represented here: # mkisofs -o source-200403121800.iso \-v sourcecode-2004-03-10-1800 \-j -r -v \`find /usr/local -name '*.tar.gz'`# find /usr/local -name '*.tar.gz'  xargs --verbose \mkisofs -o source-200403121800.iso \-v sourcecode-2004-03-10-1800 \-j -r -v

5.

Try to build and install the enscript application from its source code. This application converts ASCII files to PostScript and also supports a number of options to customize the PostScript output. For example, you can use enscript to print your scripts and other source code in an easy-to-read two-column format with line numbers . Hint: Read the INSTALL and README documents that come with the package for any special instructions.

the procedure to build enscript is identical to the one that we used to build the gftp application: # cd /usr/local/src # wget http://www.iki.fi/mtr/genscript/enscript-1.6.4.tar.gz # tar -zxvf enscript-1.6.4.tar.gz # cd enscript-1.6.4 # ./configure --prefix=/usr/local # make # make install if you cannot get enscript to install but want to use the program, you can install the binaries from the fedora core distribution. simply insert the dvd or the first cd-rom from the distribution and enter the following command: # rpm -hvi /mnt/cdrom/fedora/rpms/enscript-1.6.1-25.i386.rpm or you can install it using the main menu-system settings-add/remove application applet.

Answers

1.

If you came up with the following crontab entry, you are absolutely correct:

 # min hour  day  mon  weekday  command      */15  08-18 *    *    01-05    /usr/bin/uptime >> /var/log/load.log 

2.

Use the extended form of grep , or egrep , to specify a regular expression that will search for a number of errors in one fell swoop:

 # grep -Ei 'failwarningerrorbadrefused' /var/log/messages 

Of course, you could have split this command into five separate commands, such as:

 # grep -i fail    /var/log/messages         # grep -i warning /var/log/messages         ... 

But using the regular expression allows you to get an aggregate listing of possible issues. You can learn more about regular expressions in Chapter 13.

3.

This one is easy to solve; it can be done with one line:

 ftp.*       /var/log/ftp.log      ## log FTP messages 

4.

You can accomplish this task in a number of ways. Two approaches are represented here:

 # mkisofs -o source-200403121800.iso \                        -V SourceCode-2004-03-10-1800 \                        -J -R -v \                        `find /usr/local -name '*.tar.gz'`         # find /usr/local -name '*.tar.gz'  xargs --verbose \                      mkisofs -o source-200403121800.iso \                              -V SourceCode-2004-03-10-1800 \                              -J -R -v 

5.

The procedure to build enscript is identical to the one that we used to build the gFTP application:

 # cd /usr/local/src         # wget http://www.iki.fi/mtr/genscript/enscript-1.6.4.tar.gz         # tar -zxvf enscript-1.6.4.tar.gz         # cd enscript-1.6.4         # ./configure --prefix=/usr/local         # make         # make install 

If you cannot get enscript to install but want to use the program, you can install the binaries from the Fedora Core distribution. Simply insert the DVD or the first CD-ROM from the distribution and enter the following command:

 # rpm -hvi /mnt/cdrom/Fedora/RPMS/enscript-1.6.1-25.i386.rpm 

Or you can install it using the Main Menu>System Settings>Add/Remove Application applet.




Beginning Fedora 2
Beginning Fedora 2
ISBN: 0764569961
EAN: 2147483647
Year: 2006
Pages: 170

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net