Process and Program Management jobs

1, in the form of two options by the ps command to view the process information
[root @ localhost ~] # ps the AUX
[root @ localhost ~] # ps -elf
2, to see the process through the top command
[root @ localhost ~] # top
top - 10 : 42 is: up 56 is 2:13, Users. 3, Average Load: 0.00, 0.01, 0.05
the Tasks: Total 177, running. 1, 176 Sleeping, stopped 0, 0 Zombie
% Cpu (S): 0.0 US, SY 6.2, 0.0 Ni , 93.8 ID, 0.0 WA, 0.0 Hi, 0.0 Si, 0.0 ST
KiB Mem: 1,867,024 Total, 73908 Free, 750 376 Used, 1.04274 million BUFF / Cache
KiB Swap:. 2,097,148 Total, 2.09712 million Free, 28 Used 879 064 Avail Mem
. 3, by pgrep command to view the service sshd process ID
[root @ localhost ~] # pgrep sshd the -l
1092 sshd
2692 sshd
4, view the tree system processes
[root @ localhost ~] # pstree -aup
5, so dd if = / dev / zero of = / root / file bs = 1M count = 8190 command operations run in the foreground
[root @ localhost ~] # dd if = / dev / zero of = / root / file bs = 1M 8190 = COUNT
. 6, the fifth operation command transferred to the background questions and suspend
[the root @ localhost ~] # dd IF = / dev / ZERO of = / the root / File 1M COUNT = 8190 BS =
^ the Z
[. 1] + has stop dd IF = / dev / ZERO of = / the root / File BS = 1M COUNT = 8190
. 7, so dd if = / dev / zero of = / root / file2 bs = 1M count = 1024 command operations run in the background
[root @ localhost ~] # BG. 1
[. 1] + dd IF = / dev / ZERO of = / the root / File BS = 1M COUNT = 8190 &
. 8, see background task list
[the root @ localhost ~] # Jobs
[. 1] + run IF = in dd / dev / ZERO of = / the root / BS File = 8190 & COUNT = 1M
[the root @ localhost ~] # 8190 + 0 records read into the
recording to write the 8190 + 0
8,587,837,440 bytes (8.6 GB ) have been copied, 8.74667 seconds, 982 MB / sec
[1]+  完成                  dd if=/dev/zero of=/root/file bs=1M count=8190
9, recovery dd if = / dev / zero of = / root / file bs = 1M count = 8190 allowed to continue running in the background
[the root @ localhost ~] # BG. 1
[. 1] + dd IF = / dev / ZERO of = / root / file bs = 1M count = 8190 &
10, query dd if = / dev / zero of = / root process / file bs = 1M count = 8190 order by kill kill
[root @ localhost ~] # dd if = / dev / ZERO of = / the root / BS File = 8190 & COUNT = 1M
[. 1] 20251
[the root @ localhost ~] -9 # 20251 the kill
[the root @ localhost ~] # Jobs
[. 1] + dd if a killed = / dev / ZERO of = / root / File bs = 1M COUNT = 8190
[root @ localhost ~] #
11, a one-time set up scheduled tasks shut down the system at the time of 18:00, and view task information
[root @ localhost ~] # 18:00 aT
aT> the shutdown -h
aT> <EOT>
the job 5 aT Thu Aug 8 18:00:00 2019
12, set as root periodic scheduled tasks
a) packing compression / etc 24 o'clock every night / passwd / etc / shadow / etc / group / etc / gshadow to file.tar.gz
[the root @ localhost ~] -l -u the crontab the root #
0 0 * * * / etc / ZCF file.tar.gz the tar / etc / the passwd
0 0 * * * / etc / ZCF file.tar.gz the tar / etc / Group
0 0 * * * / etc / ZCF file.tar.gz the tar / etc / gshadow
0 0 * * * / etc / ZCF file.tar.gz the tar / etc / Shadow
B) every five minutes a week of usage lists the disk
[the root @ localhost ~] # the crontab -l -u the root
0 0 * * * / etc / ZCF file.tar.gz the tar / etc / the passwd
0 0 * * * / etc / ZCF file.tar.gz the tar / etc / Group
0 0 * * * / etc / ZCF file.tar the tar. GZ / etc / gshadow
0 0 * * * / etc / ZCF file.tar.gz the tar / etc / Shadow
* / DF. 1. 5 * * * -Th
* / DF. 1. 5 * * * -Th
C) per day 8: 30 Internet time synchronization and time synchronization server pool.ntp.org
[the root @ localhost ~] -l -u the crontab the root #
0 0 * * * / etc / ZCF file.tar.gz the tar / etc / the passwd
0 0 * * * / etc / ZCF file.tar.gz the tar / etc / Group
0 0 * * * / etc / ZCF file.tar.gz the tar / etc / gshadow
0 0 * * * / etc / ZCF file.tar.gz the tar / etc / Shadow
* / * * *. 1. 5 / bin / DF -Th
30 8 * * * /bin/pool.ntp.org
13, view the scheduled tasks root by the crontab command to list the contents of the corresponding file under / var / spool / cron file viewing via tools
[root @ localhost ~] the root the crontab -l -u #
0 0 * * * / etc / ZCF file.tar.gz the tar / etc / the passwd
0 0 * * * / etc / ZCF file.tar.gz the tar / etc / Group
0 0 * * * / etc / ZCF file.tar.gz the tar / etc / gshadow
0 0 * * * / etc / ZCF file.tar.gz the tar / etc / Shadow
* / DF. 1. 5 * * * -Th
[the root @ localhost ~] # cat / var / spool / cron / root
0 0 * * *  /etc/tar zcf file.tar.gz /etc/passwd
0 0 * * *  /etc/tar zcf file.tar.gz /etc/group
0 0 * * *  /etc/tar zcf file.tar.gz /etc/gshadow
0 0 * * *  /etc/tar zcf file.tar.gz /etc/shadow
*/5 * * * 1  df -Th

Guess you like

Origin www.cnblogs.com/CAPF/p/11321833.html