chapter10 process and task management plans

1, viewed in two forms options for ps command process information
[root @ localhost ~] # ps the AUX   // display in the form of a simple list of process information
[root @ localhost ~] # ps -elf   // display process information in long format , richer
 
2, the top command to see through the process
[root @ localhost ~] # top -b  
 
3, see the sshd service by pgrep command process ID
[root @ localhost ~] # pgrep the -l "sshd"    // the -l displays the process name
1415 sshd
2931 sshd
 
4, view the tree system processes
[root @ localhost ~] # pstree
 
5, so dd if = / dev / zero of = / root / file bs = 1M count = 8190 command operations run in the foreground
[the root @ localhost ~] # dd IF = / dev / ZERO of = / the root / File BS = 1M 8190 = COUNT     // directly executed automatically run in the foreground
 
6, the fifth operation command transferred to the background questions and suspend
[the root @ localhost ~] # dd IF = / dev / ZERO of = / the root / File COUNT = 8190 BS = 1M     // execute in the foreground, ctrl + Z tune into the background and stop execution
^ the Z-
[1] + stopped IF = dd / dev / ZERO of = / root / File bs = 1M COUNT = 8190
[root @ localhost ~] # Jobs the -l      // View list of tasks background
[ 1] + 4338 stops dd if = / dev / zero of = / root / file bs = 1M count = 8190
 
7, so dd if = / dev / zero of = / root / file2 bs = 1M count = 1024 runs in the background operation command
[the root @ localhost ~] # BG 1      // pause command transferred back to the background
[1] + dd if = / dev / zero of = / root / file bs = 1M count = 8190 &
 
8, the background task list view
[the root @ localhost ~] # Jobs -l
[. 1] + 4338 running 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 ~] # dd IF = / dev / ZERO of = / the root / File BS = 1M COUNT = 8190
^ the Z
[. 1] + stopped dd if = / dev / ZERO of = / the root / File BS = 1M COUNT = 8190
[the root @ localhost ~] # Jobs
[. 1] + stopped dd if = / dev / ZERO of = / the root / File BS = 1M COUNT = 8190
[the root @ localhost ~] # BG. 1
[. 1] + dd IF = / dev / ZERO of = / the root / File BS = 1M COUNT = 8190 &
[the root @ ~ localhost] # Jobs
[. 1] + running dd if = / dev / zero of = / root / file bs = 1M count = 8190 &
 
10, the query dd if = / dev / zero of course = / root / file bs = 1M count = 8190 order by kill kill
[root @ localhost ~] # dd if = / dev / zero of = / root / File COUNT = 8190 = 1M BS
P the Z ^ H ^
[. 1] + = IF stopped dd / dev / ZERO of = / the root / File 1M COUNT = 8190 BS =
[the root @ localhost ~] # Jobs -l
[. 1] + 4434 stop dd IF = / dev / ZERO of = / the root / File BS = 1M COUNT = 8190
[the root @ localhost ~] # BG. 1
[. 1] + dd IF = / dev / ZERO of = / the root / File BS = 1M = 8190 & COUNT
[the root @ localhost ~] # the kill -9 4434    // force kill process
[the root @ localhost ~] # Jobs -l
[. 1] + 4434 has been terminated dd if = / dev / zero of = / root / file bs = 1M count = 8190
 
11, plans to set up a one-time tasks closed at 18:00 system, and view task information
[root @ localhost ~] # DATE
2019 Nian 08 Yue 08 CST Thursday 11:22:31
[root @ localhost ~] # AT 18: 00
AT> the shutdown now -H
AT> <the EOT>
Job Thu-Aug. 1 AT. 8 18:00:00 2019
[the root @ localhost ~] # ATQ
. 1 A Thu-Aug 2019 18:00:00 the root. 8
 
12, plans to set up a recurring task as root
a) compression package / etc at 24 o'clock every night / passwd / etc / shadow / etc / group / etc / gshadow as file.tar.gz
[root @ localhost ~] # crontab -u root -e     // enter edit
[root @ localhost ~] # crontab the -l    // View Scheduled tasks
0 0 * * * tar -czf file.tar.gz / etc / passwd
0 0 * * * tar -czf File .tar.gz / etc / Shadow
0 0 * * * -czf file.tar.gz the tar / etc / Group
0 0 * * * -czf file.tar.gz the tar / etc / gshadow
b) a five-minute intervals of a week are listed disk usage
[the root @ localhost ~] # the crontab -e -u the root
* / 0. 5 * * * DF -Th
c) daily at 8:30 and Internet time synchronization server pool.ntp.org synchronization time
[the root @ localhost ~] # the crontab -e -u the root
30. 8 * * * the ntpdate pool.ntp.org
 
13, see 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 ~] # crontab -u root the -l
0 0 * * * tar -czf file.tar.gz / etc / the passwd
0 0 * * * -czf file.tar.gz the tar / etc / Shadow
0 0 * * * -czf file.tar.gz the tar / etc / Group
0 0 * * * the tar - file.tar.gz CZF / etc / gshadow
* / 0. 5 * * * -Th DF
30. 8 * * * the ntpdate pool.ntp.org
 
[root@localhost ~]# cat /var/spool/cron/root
0 0 * * * tar -czf file.tar.gz /etc/passwd
0 0 * * * tar -czf file.tar.gz /etc/shadow
0 0 * * * tar -czf file.tar.gz /etc/group
0 0 * * * tar -czf file.tar.gz /etc/gshadow
*/5     0 * * 1 df -Th
30 8 * * * ntpdate pool.ntp.org

Guess you like

Origin www.cnblogs.com/tanxiaojuncom/p/11321853.html