2.6 Given a scenario, automate and schedule jobs Flashcards

1
Q

Chron

A

The cron service allows you to schedule processes to run at specific times. The service makes use of the crond daemon, which checks every minute to see what processes should be executed. This section describes how to use this service and how to use the at command

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

AT

A

The at command is used to schedule one or more commands to be executed at one specific time in the future. The syntax for the command is at time, where time indicates when you want to execute a command. For example, the following command will allow you to schedule a command to run at 5 p.m. tomorrow:

at 5pm tomorrow
at>

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

chrontab

A

The crontab command allows a user to view or modify her crontab file. The crontab file allows a user to schedule a command to be executed on a regular basis, such as once an hour or twice a month.

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

FG

A

A paused process can be restarted in the foreground by using the fg command:

[student@OCS ~]$ jobs
[1]+ Stopped sleep 999
[student@OCS ~]$ fg %1
sleep 999

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

BG

A

A paused process can be restarted in the background by using the bg command:

[student@OCS ~]$ jobs
[1]+ Stopped sleep 999
[student@OCS ~]$ bg %1
[1]+ sleep 999 &
[student@OCS ~]$ jobs
[1]+ Running sleep 999 &

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

&

A

By default, processes started on the command line are run in the foreground. This means that the BASH shell is not accessible until the process that is running in the foreground is terminated.

Running a process in the background allows you to continue to work in the BASH shell and execute additional commands. To execute a process in the background, add an & character to the end of the command, like so:

[student@OCS ~]$ xeyes &

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

KILL

A

The kill command can be used to change the state of a process, including stopping (killing) it.

kill PID|jobnumber

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

CTRL-C

A

When a process is running in the foreground, a SIGINT signal can be sent to a process by holding down the Ctrl key and pressing the letter c. A SIGINT signal is designed to stop a program prematurely

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

CTRL-Z

A

When a process is running in the foreground, a SIGTSTP signal can be sent to a process by holding down the Ctrl and pressing the letter z. A SIGTSTP signal is designed to pause a program. The program can then be restarted by either the bg or the fg command

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

NOHUP

A

Each process has a parent process that started it. For example, if you execute a command in a BASH shell, that command’s parent process is the BASH shell process.

When a parent process is stopped, a hang-up (HUP) signal is sent to all the child processes. This HUP signal is designed to stop the child processes. By default, a child process will stop when sent an HUP signal.

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