Scheduling tasks Flashcards

1
Q

Crontab file

A

/etc/crontab

  • minute (0-59)
  • hour (0-23)
  • day of month (1-31)
  • month (1-12) or jan,feb,mar
  • day of week (0-6) or sun,mon…
  • user-name
  • command to be executed
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Create job with at

A

at now + 5 minutes
enter command
press ctrl+d

at 12:01 am
at 4:00 AM tomorrow
at -f /home/user/script.sh 10:00 AM Oct 8 2018

example
at now +1 minute
at> logger “The system uptime is $(untime)”
ctrl+d

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

List at queue

A

atq

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

Remove schedule at’s job

A

atrm [job number]

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

Allow/ Deny users to run schedule a job with at

A

vim /etc/at.allow
add root to allow root to schedule at jobs
vim /etc/at.deny
add user to deny user to schedule at jobs

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

Location of dirs where scripts could be run on a regular basis as if they were cron jobs

A

/etc/cron.hourly/
/etc/cron.dailly/
/etc/cron.weekly/
/etc/cron.monthly/

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

Dir contains cron scripts for entire system

A

/etc/cron.d/

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

Forbid users to create cron jobs

A

/etc/cron.deny

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

Set up cron job

A
crontab -e
*/2 4 * * * /usr/bin/tar -czf myfile.tar.gz /home/user/important_ file1
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

List cron jobs

A

crontab -l

crontab -l -u kenny

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

Location of where cron job will be saved

A

/var/spool/cron/

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

Set up cron job

A
crontab -e
*/2 4 * * * /usr/bin/tar -czf myfile.tar.gz /home/user/important_ file1
How well did you know this?
1
Not at all
2
3
4
5
Perfectly