Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Linux+ Certification Bible.pdf
Скачиваний:
48
Добавлен:
15.03.2015
Размер:
3.78 Mб
Скачать

352 Chapter 10 Study Guide

Lab 10-2 Creating cron jobs

The objective for this hands-on lab is to gain experience in creating cron jobs. You should be able to use any distribution of Linux for this installation exercise.

1.Create several crontab compatible files to perform some routine tasks.

2.Use the crontab command to activate the cron jobs.

3.Verify that the jobs run correctly.

4.Repeat as often as needed.

Answers to Chapter Questions

Chapter Pre-test

1.Linux is a true multi-user environment that allows multiple users to access a system locally or remotely at the same time.

2.Linux includes the ability to use virtual terminals, multiple logins, and remote logins all on the same system at the same time.

3.Linux uses virtual consoles, serial terminals, and Ethernet workstations to allow multiple users access to the same system.

4.Linux can provide Ethernet terminals by using the tools available through the Linux Terminal Server Project.

5.Linux can use netstat to monitor remote connections.

6.The most common shells used in Linux today are BASH, PDKSH (often known as Korn Shell), TCSH, and Z-shell.

7.The BASH or Bourne Again SHell is the most common shell used in Linux.

8.A script can be created to perform repetitive tasks on a Linux system.

9.The use of the cron daemon and crontab command to convert shell commands into scheduled tasks is available on a Linux system.

10.The “best practice” way to login as the root user on a Linux system is to use a standard user account and then the su command to gain root access.

Assessment Questions

1.B. The keystrokes used to move from one virtual console to another is the <Alt> <Fx> combination. The other combinations don’t normally produce the desired effect. For review, see the “Multi-User Environment” section.

Chapter 10 Study Guide 353

2.C. Linux normally provides the ability to support 63 virtual consoles. The others are not correct for the standard Linux environment. For review, see the “The creation of Virtual Consoles” section.

3.D. A terminal server can provide the desired terminals. DHCP provides dynamic IP addresses, Samba provides services for Microsoft Windows clients, and Virtual Consoles are not normally considered the most inexpensive method of providing consoles. For review, see the “The Linux Terminal Server Project” section.

4.A. The download of the Linux kernel is performed via tftp when using the LTSP method of creating terminals. The abilities of ftp to transfer files are not used, and DHCP and bootp are used to provide IP addresses. For review, see the “The Linux Terminal Server Project” section.

5.C. The file /etc/inittab is used to adjust the number of virtual consoles. The other files are not used to adjust the number of virtual consoles. For review, see the “The creation of Virtual Consoles” section.

6.A and C. The bootp and DHCP services are used to provide IP addresses for the LTSP systems. For review, see the “Configurations for remote systems” section.

7.B. The Etherboot package may be used to create network bootable terminals for the Linux Terminal Server Project system. The lts_core package is the LTSP package, the XDM is a Linux system used to provide terminal logins, and syslogd controls the system messages. For review, see the “Configurations for remote systems” section.

8.D. The netstat command is used to monitor connections to a Linux system. The nbstat, tracert, and ipconfig programs are not normally used in the Linux environment. For review, see the “Monitoring remote connections” section.

9.A and D. The Bourne Again SHell uses features of the Korn and C shell. The others are available shells for Linux. For review, see the “Common Shell Commands” section.

10.C. The bash executable is normally located in /bin/bash. For review, see the “Common Shell Commands” section.

11.B. The daemon used to perform automatic tasks is the cron daemon. The crontab command is used with cron, cron.d is one of the support files systems, and crontab.d is normally not used in the Linux environment. For review, see the “Basic shell scripts” section.

12.A. The correct way to indicate a shell script is to use #!/bin/sh at the beginning of the file. For review, see the “Basic shell scripts” section.

13.B. The su command allows not only the ability to login as the root user but as any user on a system. The vi command is an editor, chmod is used to administer user accounts, and chuser is not a normal Linux command. For review, see the “Caution using root access” section.

354 Chapter 10 Study Guide

14.D. The opening of a terminal in Linux can be used to provide a command line in the GUI. For review, see the “Navigating the GUI interface” section.

15.C. The package that is used to install the LTSP is lts_core and the others are not. For review, see the “Configurations for remote systems” section.

16.A. The command rpm -i lts_core-2.XX-XX.i386.rpm will install the Linux Terminal Server Project core packages. The others won’t work because the options -I, -e and -u don’t install packages. For review, see the “Configurations for remote systems” section.

17.A. The line S2:3:respawn:/sbin/uugetty ttyS2 M19200 is the only line that will create a virtual console on a serial port to allow modem or external connections. For review, see the “Configurations for remote systems” section.

18.B. The file /etc/dhcpd.conf.example provides a starting point for the configuration file needed to start the DHCP service. The others are not provided to help start the DHCP service. For review, see the “Configurations for remote systems” section.

19.B. The need for a firewall is created to protect the LTSP server from outside access. A router can provide a firewall but does not always do so, tftp allows the download of the Linux kernel, and portmapper does not protect the system. For review, see the “Configurations for remote systems” section.

20.D. The file that provides most of the workstation information is /tftpboot/ lts/ltsroot/etc/lts.conf. For review, see the “Configurations for remote systems” section.

Scenarios

1.The use of a system of Linux Terminal Servers will resolve most of the future cost needs. Because the servers provide the system resources such as processing and disk space, only the servers must be upgraded to provide most performance enhancements.

2.The creation of a virtual console on a serial port can allow remote access to a Linux system and provide some diagnostic abilities before traveling to the site.

Linux System 11C H A P T E R

Commands

EXAM OBJECTIVES

4.12 Create, extract and edit file and tape archives using tar

4.13 Manage runlevels using init and shutdown

4.14 Stop, start, and restart services (daemons) as needed (e.g., init files)

4.15 Manage print spools and queues

4.16 Create, edit and save files using vi

356 Part IV Administration

CHAPTER PRE-TEST

1.What is the purpose of the tar command?

2.What does runlevel 0 indicate?

3.Why should the Linux system be shut down properly?

4.What process runs the print spooler?

5.Where are most startup scripts located?

6.What do “S” and “K” stand for when naming scripts?

7.How do you enter command mode in the vi editor?

8.What runlevel does the Graphical User Interface run at?

9.What command do you use to print from the command line?

10.How do you extract a tape archive file?

Answers to these questions can be found at the end of the chapter.