Scheduling Flashcards
atd vs crond
atd: onet ime jobs
crond: recurring jobs
Which commands to use to schedule jobs
one off: at
recurring: crontab
Determine which jobs are schedule for one time execute
atq
remove an at job
atrm 2
Can’t open /run/atd.pid to signal atd. No atd running?
Install atd
Schedule an AT job for 5 min from now
at now +5min
teatime
4pm
Execute command at teatime and put the job in a queue called g
at -q g teatime
Cat an at
job to the console
at -c 7
In order, list the fields of a cron job
minute
hour
day of month
month
day of week
command
In cron, what are values for day of the week?
0, 7 for Sunday
1 for Monday
true command
do nothing and return success code 0
false command
do nothing and return success code of 1
List the cron tabs
crontab -l
Install cron
dnf install cronie
Create a cron job
crontab -e
source fancy dot command
. ~/.bashrc
Explain the crontab:
15,45 08,11,14 * * 1-5 /bin/true
At 15 min or 45 min after 08, 11 or 1pm, any day of the month and for every month for working days, run /bin/true
Explain the cron tab:
*/10 * * * * /bin/true
Every tenth instance of every hour, every day of month, every month, every day of the week
List the crontabs of student user
crontab -l -u student
Where are cront tab installed
/var/spool/cron
remove the crontab for student user
crontab -r -u student
How many fields are used for user cron tabs?
6: min, hour, day of month, month, day of week command
How many fields are used for system cron tabs?
7
additional field for the suer that the job is going to be executed as