当前位置:网站首页>Processes and Scheduled Tasks

Processes and Scheduled Tasks

2022-08-09 08:09:00 small glimmer

insert image description here

View progress

insert image description here
insert image description here
Insert image description here

A single-core, single-threaded CPU can run multiple multi-threaded applications, but it takes time to slowly load resource processing tasks

Controlling Process

insert image description here
insert image description here

D: Daemon

R: Running

S: Sleep state

Z: Zombie state

Priority:

<: high priority

N: low priority

l: The process is multithreaded

+: foreground process

ctrl-c is to send a SIGINT signal to terminate a process

ctrl-z is to send a SIGSTOP signal to suspend a process.Put the job in the background (pause)

ctrl-d does not send a signal, but a special binary value, which means EOF.Represents input completion or logout

ps -elf #will display process information in the system in long format

-e: Display all process information in the system.

-1: Display process information in long format.

-f: Display process information in full format.

Explanation of each column:
F: The system flag assigned to the process by the kernel.
S: The state of the process.
UID: The user who started these processes.
PID: Process ID of the process.
PPID: Process ID of the parent process (if the process is started by another process)
C: CPU utilization during the lifetime of the process.
PRI: The priority of the process (the higher the number, the lower the priority).
NI: The humility value is used to determine the priority.
ADDR: The memory address of the process.
SZ:If the process is swapped out, the approximate size of the required swap space.
WCHAN: If the process is sleeping, display the name of the system function in sleep.
STIME: The system time when the process was started.
TTY: The terminal device when the process starts. pts/0255 represents the virtual terminal, usually the terminal connected remotely; tty1tty7 represents the local console terminal
TIME: The cumulative CPU time required to run the process.
CMD: The start command of the process.

Zombie process:
A process ends, but if the parent process of the process has already ended first, then the process will not become a zombie process, because when each process ends, the system will scan the current systemFor all the processes running in the process, see if any process is a child process of the process that has just ended. If so, Init will take over it and become its parent process. After the child process exits, init will reclaim the related occupiedresource.However, when the child process ends before the parent process, and the parent process does not recycle the child process and release the resources occupied by the child process, the child process will become a zombie process.
insert image description here
insert image description here
Insert image description here
insert image description here

pstree -aup username→this user must be activated to view the process
hereInsert image description

& indicates that the process is running in the background, the user can continue to execute other command operations, and can enter fg to bring the process to the foreground

crtl +z just suspends the process (calls it into the background and stops execution), but it is not cleared, you can enter kill -9 process number, and then send a signal to clear the process.

bg can resume tasks that are suspended in the background (such as crtl +z suspended) and continue to execute in the background

fg can restore background tasks to the foreground
insert image description here

jobs -l can view the process ID and then enter kill -9+ process ID to clear the job

killall -9 + task name

at one-time task settings

insert image description here
insert image description here

crontab periodic task settings

insert image description here
insert image description here
insert image description here
insert image description here
crontab -eScheduled periodic writes

crontab -l lists scheduled tasks

The minute is any integer from 0 to 59
The hour is any integer from 0 to 23
The date is any integer from 1 to 31
The month value is any integer from 1 to 12
The week value is any integer from 0 to 7, 0 or 7 represents Sunday
The command or program script to be executed by the command

Special representation of time values

  • Represents any time within the range
    , represents multiple discrete time points in the interval
  • represents a continuous time range
    / specifies the time frequency of the interval
原网站

版权声明
本文为[small glimmer]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/221/202208090759512335.html