Home
You may like this!
36.
Which of the following tasks are most likely to be handled by a cron job? (Select two.)
  • A.
    Starting an important server when the computer boots
  • B.
    Finding and deleting old temporary files
  • C.
    Scripting supervised account creation
  • D.
    Monitoring the status of servers and emailing a report to the superuser
  • E.
    Sending files to a printer in an orderly manner
  • Answer & Explanation
  • Report
Answer : [B, D]
Explanation :
The cron utility is a good tool for performing tasks that can be done in an unsupervised manner, such as deleting old temporary files (option B) or checking to see that servers are running correctly (option D). Tasks that require interaction, such as creating accounts (option C), aren’t good candidates for cron jobs, which must execute unsupervised. Although a cron job could restart a crashed server, it’s not normally used to start a server when the system boots (option A); that’s done through system startup scripts or a super server. Sending files to a printer (option E) is generally handled by a print server such as CUPS.
Report
Name Email  
37.
Which of the following lines, if used in a user cron job, will run /usr/local/bin/cleanup twice a day?
  • A.
    15 7,19 * * * tbaker /usr/local/bin/cleanup
  • B.
    15 7,19 * * * /usr/local/bin/cleanup
  • C.
    15 */2 * * * tbaker /usr/local/bin/cleanup
  • D.
    15 */2 * * * /usr/local/bin/cleanup
  • E.
    2 * * * * /usr/local/bin/cleanup
  • Answer & Explanation
  • Report
Answer : [B]
Explanation :
User cron jobs don’t include a username specification (tbaker in options A and C). The */2 specification for the hour in options C and D causes the job to execute every other hour; the 7,19 specification in options A and B causes it to execute twice a day, on the 7th and 19th hours (in conjunction with the 15 minute specification, that means at 7:15 a.m. and 7:15 p.m.). Thus, option B provides the correct syntax and runs the job twice a day, as the question specifies, whereas options A, C, and D all get something wrong. Option E causes the job to run once an hour, not twice a day.
Report
Name Email  
38.
You’re installing Linux on a laptop computer. Which of the following programs might you want to add to ensure that log rotation is handled correctly?
  • A.
    tempus
  • B.
    anacron
  • C.
    crontab
  • D.
    ntpd
  • E.
    syslog-ng
  • Answer & Explanation
  • Report
Answer : [B]
Explanation :
The anacron program is a supplement to cron that helps ensure that log rotation, /tmp directory cleanup, and other traditional cron tasks are handled even when the computer is shut down (and, hence, when cron isn’t running) for extended periods of time. Thus, this is the program to add to the system to achieve the stated goal, and option B is correct. There is no common Linux utility called tempus, so option A is incorrect. Option C’s crontab is the name of a file or program for controlling cron, which is likely to be an unreliable means of log rotation on a laptop computer. The ntpd program (option E) is the NTP daemon, which helps keep the system clock in sync with an external source. Although running ntpd on a laptop computer is possible, it won’t directly help with the task of scheduling log rotation. The syslog-ng package is an alternative system log daemon, but this program doesn’t help solve the problem of potentially unreliable log rotation on laptops when using standard cron utilities.
Report
Name Email  
39.
What do the following commands accomplish? (The administrator presses Ctrl+D after typing the second command.)
# at teatime
at> /usr/local/bin/system-maintenance
  • A.
    Nothing; these commands aren’t valid.
  • B.
    Nothing; teatime isn’t a valid option to at.
  • C.
    Nothing; you may only type valid bash built-in commands at the at> prompt
  • D.
    Nothing; at requires you to pass it the name of a script, which teatime is not.
  • E.
    The /usr/local/bin/system-maintenance program or script is run at 4:00 p.m.
  • Answer & Explanation
  • Report
Answer : [E]
Explanation :
The at command runs a specified program at the stated time in the future. This time may be specified in several ways, one of which is teatime, which stands for 4:00 p.m. Thus, option D is correct. The objections stated in options A, B, C, and D are all invalid. (You may pass a script to at with the -f parameter, but this isn’t required, contrary to option D.)
Report
Name Email  
40.
How might you schedule a script to run once a day on a Linux computer? (Select two.)
  • A.
    Place the script, or a link to it, in /etc/cron.daily.
  • B.
    Use the at command to schedule the specified script to run on a daily basis at a time of your choosing.
  • C.
    Create a user cron job that calls the specified script once a day at a time of your choosing, and install that cron job using crontab.
  • D.
    Use run-parts to schedule the specified script to run on a daily basis.
  • E.
    Type crontab -d scriptname, where scriptname is the name of your script
  • Answer & Explanation
  • Report
Answer : [A, C]
Explanation :
The contents of /etc/cron.daily are automatically run on a daily basis in most Linux distributions, and the crontab utility can create user cron jobs that run programs at arbitrary time intervals, so both A and C are correct. The at command noted in option B can be used to run a program a single time, but not on a regular basis (such as daily). Option D’s run-parts utility is used by some distributions as a tool to help run programs in the /etc/cron.* subdirectories, but it’s not used to schedule jobs. Although the crontab program can maintain user crontabs, it’s not used as shown in option E, and it has no -d parameter at all.
Report
Name Email