Task Scheduling Flashcards

1
Q

What is the at utility?

A

Allows scheduling the execution of one time command in the future

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

How do you schedule a command to run with at?

A

i.e at 21:00
at now +1 minute
logger “Uptime is $(uptime)” *to save press ctrl + d twice

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

How do you view all at jobs?

A

atq

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

How do you remove an at job?

A

atrm {jid}

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

How do you control access over who can use the at command?

A

Create file in /etc/
at.deny whitelists everyone except in the file
at.allow blacklists everyone except in the file
Only one of these can exist in /etc/

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

What is cron?

A

Allows scheduling or reoccurring commands

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

how do you control access over who can use the cron command?

A

Create file in /etc/

cron. deny whitelists everyone except in the file
cron. allow blacklists everyone except in the file

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

Where are system cron jobs stored?

A

/etc/crontab

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

What is the syntax for scheduling a cron job?

A

m h dom m dow u com
i.e * * * * * root ping abc.xyz -c 1&raquo_space; ~/ping

minute, hour, day of month, month, day of week, user, command. Only user field exists for system cron

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

Where can files be placed to be run by cron?

A

/etc/cron.hourly/
/etc/cron.daily/
/etc/cron.weekly/
/etc/cron.monthly/

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

What executes scripts placed in different cron folders?

A

/etc/anacrontab
anacron ensures jobs run that have missed their window
/etc/cron.d/0hourly is the same but specifically for hoursly jobs as anacron enables specifying a delay for pending jobs to be run

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

How do you create a custom job in anacron and run it immediately to test?

A

Edit /etc/anacrontab
(period in days) (delay in minutes) (job-identifier) (command)

anacron

  • f force run jobs
  • n force run jobs serially ignoring delays
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

How does anacron keep track of which jobs need to be run in the event they have missed their window?

A

The job-identifier in /etc/anacrontab is used by anacron to check the last time the job was ran. It is located in /var/spool/anacron/

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