cron & crontab Flashcards

1
Q

How to check crontab for all users on server?

A

?

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

How to edit your own crontab?

A

crontab -e

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

Edit root crontab?

A

sudo crontab -e

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

Crontab sections?

A

minute (0-59), hour (0-23, 0 = midnight), day (1-31), month (1-12), weekday (0-6, 0 = Sunday), command
like in ‘01 04 1 1 1 /usr/bin/somedirectory/somecommand’ (which will run at 4:01am on January 1st plus every Monday in January)

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

What is asterisk symbol meaning in crontab?

A

Every instance of given time period will be used. Say, first * means that a script will run every minute, etc.

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

What are comma-separated values in crontab sections?

A

Означают, что событие должно происходить несколько раз за определенный период времени. Например, 01,31 в минутах означает, что команда будет запускаться в 1 и 31 минуту (указанного дальше периода времени)

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

What are divisors (/) in crontab sections?

A

Run a script some number of times per time unit. For example if you want to run it every 10 minutes use the following crontab entry (runs on minutes divisible by 10: 0, 10, 20, 30, etc.): */10 etc.
(equiv. to 0,10,20,30,40,50 etc.)

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

What option is to show current crontab to stdout?

A

crontab -l

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

What option removes current crontab?

A

crontab -r

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

What editor will be used when editing current crontab via crontab -e?

A

Specified in $EDITOR env var.

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