nerdexam
CompTIA

XK0-005 · Question #309

Joe, a user, asks a systems administrator to schedule the daily execution of a custom script. Which of the following commands will allow the systems administrator to set up Joe's cron job?

The correct answer is B. crontab -e -u joe. To set up a cron job for a specific user like Joe, the systems administrator should use the crontab -e -u joe command, which allows editing the user's crontab file.

System Management

Question

Joe, a user, asks a systems administrator to schedule the daily execution of a custom script. Which of the following commands will allow the systems administrator to set up Joe’s cron job?

Options

  • Acrontab -r -u joe
  • Bcrontab -e -u joe
  • Ccrontab -n -u joe
  • Dcrontab -l -u joe

How the community answered

(15 responses)
  • B
    93% (14)
  • D
    7% (1)

Why each option

To set up a cron job for a specific user like Joe, the systems administrator should use the `crontab -e -u joe` command, which allows editing the user's crontab file.

Acrontab -r -u joe

The `crontab -r -u joe` command removes all cron jobs for the user "joe" without prompting, which is destructive and not for setting up new jobs.

Bcrontab -e -u joeCorrect

The `crontab -e -u joe` command opens the crontab file for the user "joe" in a text editor, allowing the administrator to add, modify, or delete scheduled tasks (cron jobs) for that user. The `-e` flag stands for "edit", and `-u` specifies the user.

Ccrontab -n -u joe

The `crontab` command does not have a `-n` option; this is not a valid flag for managing cron jobs.

Dcrontab -l -u joe

The `crontab -l -u joe` command lists the existing cron jobs for the user "joe", but it does not allow for adding or editing new jobs.

Concept tested: Managing user cron jobs

Source: https://man7.org/linux/man-pages/man1/crontab.1.html

Topics

#cron#task scheduling#system administration#crontab command

Community Discussion

No community discussion yet for this question.

Full XK0-005 Practice