Chapter 12 - Scheduling Tasks Flashcards

1
Q

What is cron service?

A

cron service is used as a generic service to run processes automatically at specific times.

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

What does crond or the cron daemon do?

A

The crond daemon wakes up every minute and checks its configuration to see whether anything needs to be started.

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

What are the two components of cron?

A

cron daemon (crond) and the cron configuration which defines what job it has to do

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

Which command to monitor the status of cron service?

A

systemctl status crond -l

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

Where is the main configuration file for cron located?

A

/etc/crontab

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

How to create user specific cron job?

A

After logging in as that user, type crontab -e or when logged is as root, type : crontab -e -u username

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

What is the purpose of anacron?

A

To ensure regular execution of the job, Cron uses the anacron service. This service takes care of starting the hourly, daily, weekly, and monthly cron jobs, no matter at which exact time.

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

Which command to see a list of cron jobs for the current user account?

A

crontab -l

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

How to manage cron security i.e limit which user to allow to schedule cron jobs and which user not to?

A

Using the /etc/cron.allow and /etc/cron.deny files.

Only root user can use the cron if neither file exists

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

What is the at command , atq command and atrm command? And how different is at from cron

A

Whereas cron is used to schedule jobs that need to be executed on a regular basis, the atd service is available for services that need to be executed only once.
at command is used to run a job through the atd service
atq command is used to see a list of all the scheduled jobs in atd service
atrm command is used to remove the scheduled jobs

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

how to scheduled a job using the at command?

A

To run a job through the atd service, you would use the at command, followed by the time the job needs to be executed. After you type this, the at shell opens. From this shell, you can type several commands that will be executed at the specific time that is mentioned. After entering the commands, press Ctrl-D to quit the at shell.

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