Cron and at 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

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
3
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
4
Q

Location of where cron job will be saved

A

/var/spool/cron/user_name_run_crontab -e

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

Remove crontab jobs

A

crontab -r -u kenny

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

Create job with at

A

at now + 5 minutes
enter command
press ctrl+d

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

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

List at queue

A

atq

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
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
12
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