5.2 Cron and Scheduled Jobs Flashcards

1
Q

A _________ is a script or command designated to run at periodic predetermined intervals.

A

A cron job is a script or command designated to run at periodic predetermined intervals.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is a daemon?

A

A daemon is a computer program that runs as a background process, rather than being directly controlled by an interactive user.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is Cron?

A

cron is a robust task scheduler that allows users to schedule repetitive tasks to run on a regular basis.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

____________are often started at boot up. While other

____________ respond to network requests and hardware activity, cron is initiated at designated time intervals.

A

Daemons are often started at boot up. While other
daemons respond to network requests and hardware
activity, cron is initiated at designated time intervals.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Tasks are stored and scheduled in a file called a ___________.

A

Tasks are stored and scheduled in a file called a crontab (cron table).

  • Each user has their own individual, private crontab.
  • System crontabs for system level actions.
  • Tasks scheduled by users. are run under that user’s privilege level.
  • Root users can have a crontab too.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Crontabs come in two varieties. What are they?

A
  • User-level: runs for a specific user under their privilege level.
  • System-level: runs for the system as a whole under root privileges.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is the general syntax for a crontab?

A

minute hour day-of-month month day-of-week command

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What goes in this directory?

/etc/cron/d

A

custom cron jobs

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Lynis is a security scanner used to ____________________.

A

Lynis is a security scanner used to check a machine for vulnerabilities.

  • Generates and saves reports of its findings for administrators to review.
  • Offers numerous scan types.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q
  • When will the following cron schedules run?*/10 * * * *
A

At every 10th minute.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q
  • What event is the following cron a minute away from?

59 23 31 12 *

A

New years

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What do the following hypothetical cron likely do?

0 18 * * 1-5 /home/Bob/Sales/sum_of_sales.sh

A
  1. Run a script that adds up all the sales for the work day.

2. A weekly automated system upate.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is a shebang?

A

Is the commented file declaration at the top of a shell script.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Is the .sh extension needed for shell scripts?

A

Nope! As long as the shebang is there, the file should be able to run as a script!

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What two characters should come before the filename of a script?

A

./

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Jane’s script has user and group ownership of a script with -rw-r--r-- permissions, but she cannot get it to run. What must she do to the file before it will run?

A

Run chmod +x on her file!

17
Q

How does the -x option modify the tar command?

A

This option will let tar extract an archive!

18
Q

If a directory has ten files and the following command is used in it, how many files are being archived?

tar cvvWf backups/archive.tar

A

Zero, because tar doesn’t compress!! But all files should be archived as they’re all in ., the current directory!

19
Q

What option prints the full file specification of files as you interact with them?

A

-vv

20
Q

Why is the -f option used in almost every tar operation?

A

The -f option lets you designate a tar file to either create or extract or list from.