|||
存储空间大于2个T,fdisk 不能分大于两个T的磁盘。大于2个T用parted
1. 进程管理
什么是进程?
查看进程,ps命令
[root@localhost pub]#ps
PID TTY TIME CMD
2316 pts/0 00:00:00 bash
2403 pts/0 00:00:00 fdisk
2426 pts/0 00:00:00 fdisk
2894 pts/0 00:00:00 ps
[root@localhost pub]# psaux
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 1 0.0 0.1 2900 1436 ? Ss 20:17 0:01 /sbin/init
root 2 0.0 0.0 0 0 ? S 20:17 0:00 [kthreadd]
root 3 0.0 0.0 0 0 ? S 20:17 0:00 [migration/0]
root 4 0.0 0.0 0 0 ? S 20:17 0:00 [ksoftirqd/0]
root 5 0.0 0.0 0 0 ? S 20:17 0:00 [migration/0]
root 6 0.0 0.0 0 0 ? S 20:17 0:00 [watchdog/0]
root 7 0.0 0.0 0 0 ? S 20:17 0:00 [events/0]
root 8 0.0 0.0 0 0 ? S 20:17 0:00 [cgroup]
root 9 0.0 0.0 0 0 ? S 20:17 0:00 [khelper]
root 10 0.0 0.0 0 0 ? S 20:17 0:00 [netns]
root 11 0.0 0.0 0 0 ? S 20:17 0:00 [async/mgr]
root 12 0.0 0.0 0 0 ? S 20:17 0:00 [pm]
root 13 0.0 0.0 0 0 ? S 20:17 0:00 [sync_supers]
root 14 0.0 0.0 0 0 ? S 20:17 0:00 [bdi-default]
root 15 0.0 0.0 0 0 ? S 20:17 0:00 [kintegrityd/0]
root 16 0.0 0.0 0 0 ? S 20:17 0:00 [kblockd/0]
root 17 0.0 0.0 0 0 ? S 20:17 0:00 [kacpid]
root 18 0.0 0.0 0 0 ? S 20:17 0:00 [kacpi_notify]
root 19 0.0 0.0 0 0 ? S 20:17 0:00 [kacpi_hotplug]
root 20 0.0 0.0 0 0 ? S 20:17 0:00 [ata_aux]
root 21 0.0 0.0 0 0 ? S 20:17 0:00 [ata_sff/0]
root 22 0.0 0.0 0 0 ? S 20:17 0:00 [ksuspend_usbd]
root 23 0.0 0.0 0 0 ? S 20:17 0:00 [khubd]
root 24 0.0 0.0 0 0 ? S 20:17 0:00 [kseriod]
root 25 0.0 0.0 0 0 ? S 20:17 0:00 [md/0]
root 26 0.0 0.0 0 0 ? S 20:17 0:00 [md_misc/0]
root 27 0.0 0.0 0 0 ? S 20:17 0:00 [linkwatch]
root 28 0.0 0.0 0 0 ? S 20:17 0:00 [khungtaskd]
root 29 0.0 0.0 0 0 ? S 20:17 0:00 [kswapd0]
root 30 0.0 0.0 0 0 ? SN 20:17 0:00 [ksmd]
root 31 0.0 0.0 0 0 ? S 20:17 0:00 [aio/0]
root 32 0.0 0.0 0 0 ? S 20:17 0:00 [crypto/0]
root 37 0.0 0.0 0 0 ? S 20:17 0:00 [kthrotld/0]
root 38 0.0 0.0 0 0 ? S 20:17 0:00 [pciehpd]
root 40 0.0 0.0 0 0 ? S 20:17 0:00 [kpsmoused]
root 41 0.0 0.0 0 0 ? S 20:17 0:00 [usbhid_resume]
root 71 0.0 0.0 0 0 ? S 20:17 0:00 [kstriped]
root 146 0.0 0.0 0 0 ? S 20:17 0:00 [scsi_eh_0]
root 147 0.0 0.0 0 0 ? S 20:17 0:00 [scsi_eh_1]
root 154 0.0 0.0 0 0 ? S 20:17 0:00 [mpt_poll_0]
root 155 0.0 0.0 0 0 ? S 20:17 0:00 [mpt/0]
root 156 0.0 0.0 0 0 ? S 20:17 0:00 [scsi_eh_2]
root 283 0.0 0.0 0 0 ? S 20:17 0:00 [jbd2/sda2-8]
root 284 0.0 0.0 0 0 ? S 20:17 0:00 [ext4-dio-unwr]
root 338 0.0 0.0 0 0 ? S 20:17 0:00 [flush-8:0]
root 376 0.0 0.1 3028 1312 ? S<s 20:17 0:00 /sbin/udevd -d
root 817 0.0 0.0 0 0 ? S 20:18 0:00 [bluetooth]
root 825 0.0 0.0 0 0 ? S 20:18 0:00 [vmmemctl]
root 926 0.0 0.0 0 0 ? S 20:18 0:00 [jbd2/sda1-8]
root 927 0.0 0.0 0 0 ? S 20:18 0:00 [ext4-dio-unwr]
root 975 0.0 0.0 0 0 ? S 20:18 0:00 [kauditd]
root 1272 0.0 0.0 36592 780 ? Ssl 20:18 0:00 /usr/sbin/vmwar
root 1293 0.1 0.3 39328 4080 ? Sl 20:18 0:03 /usr/sbin/vmtoo
root 1570 0.0 0.0 13824 812 ? S<sl 20:18 0:00 auditd
root 1595 0.0 0.1 35976 1500 ? Sl 20:18 0:00 /sbin/rsyslogd
dbus 1665 0.0 0.1 13880 1724 ? Ssl 20:18 0:00 dbus-daemon --s
root 1676 0.0 0.4 32200 4616 ? Ssl 20:18 0:00 NetworkManager
root 1681 0.0 0.2 4796 2280 ? S 20:18 0:00 /usr/sbin/modem
root 1695 0.0 0.3 12336 3404 ? Ss 20:18 0:00 cupsd -C /etc/c
root 1698 0.0 0.1 2836 1244 ? S 20:18 0:00 /sbin/dhclient
root 1701 0.0 0.0 7596 648 ? Ss 20:18 0:00 /usr/sbin/wpa_s
root 1726 0.0 0.0 2020 580 ? Ss 20:18 0:00 /usr/sbin/acpid
68 1735 0.0 0.4 17740 4952 ? Ssl 20:18 0:00 hald
root 1736 0.0 0.1 3980 1272 ? S 20:18 0:00 hald-runner
root 1769 0.0 0.1 4052 1044 ? S 20:18 0:00 /usr/libexec/ha
root 1779 0.0 0.1 4052 1176 ? S 20:18 0:00 hald-addon-inpu
68 1787 0.0 0.0 3644 1004 ? S 20:18 0:00 hald-addon-acpi
root 1807 0.0 0.1 4292 1740 ? S<s 20:18 0:00 /usr/sbin/bluet
root 1830 0.0 0.1 8944 1044 ? Ss 20:18 0:00 /usr/sbin/sshd
root 1884 0.0 0.1 12760 1396 ? Ss 20:18 0:00 tpvmlpd2
root 1891 0.0 0.0 0 0 ? S< 20:18 0:00 [krfcommd]
root 1949 0.0 0.2 3556 2068 ? S< 20:18 0:00 /sbin/udevd -d
root 2011 0.0 0.2 12964 2596 ? Ss 20:18 0:00 /usr/libexec/po
postfix 2024 0.0 0.2 13040 2564 ? S 20:18 0:00 pickup -l -t fi
postfix 2025 0.0 0.2 13108 2604 ? S 20:18 0:00 qmgr -l -t fifo
root 2035 0.0 0.0 5312 840 ? Ss 20:18 0:00 /usr/sbin/abrtd
root 2043 0.0 0.1 6000 1280 ? Ss 20:18 0:00 crond
root 2054 0.0 0.0 2988 468 ? Ss 20:18 0:00 /usr/sbin/atd
root 2069 0.0 0.2 16548 2192 ? Ssl 20:18 0:00 /usr/sbin/gdm-b
root 2076 0.0 0.0 2008 500 tty2 Ss+ 20:18 0:00 /sbin/mingetty
root 2079 0.0 0.0 2008 476 tty3 Ss+ 20:18 0:00 /sbin/mingetty
root 2081 0.0 0.0 2008 476 tty4 Ss+ 20:18 0:00 /sbin/mingetty
root 2084 0.0 0.0 2008 476 tty5 Ss+ 20:18 0:00 /sbin/mingetty
root 2086 0.0 0.1 3552 2012 ? S< 20:18 0:00 /sbin/udevd -d
root 2087 0.0 0.0 2008 480 tty6 Ss+ 20:18 0:00 /sbin/mingetty
root 2103 0.0 0.3 20380 3320 ? Sl 20:18 0:00 /usr/libexec/gd
root 2106 0.6 2.7 45248 28440 tty1 Ss+ 20:18 0:18 /usr/bin/Xorg :
root 2122 0.0 0.3 22616 3180 ? Sl 20:18 0:00 /usr/sbin/conso
gdm 2192 0.0 0.0 3628 628 ? S 20:18 0:00 /usr/bin/dbus-l
root 2198 0.0 0.2 6504 2800 ? S 20:18 0:00 /usr/libexec/de
root 2240 0.0 0.3 7272 3916 ? S 20:18 0:00 /usr/libexec/po
rtkit 2249 0.0 0.1 25104 1164 ? SNl 20:18 0:00 /usr/libexec/rt
root 2287 0.0 0.2 19364 2872 ? Sl 20:19 0:00 pam: gdm-passwo
root 2312 0.0 0.3 11888 3692? Ss 20:23 0:00 sshd: root@pts/
root 2316 0.0 0.1 5260 1668 pts/0 Ss 20:23 0:00 -bash
root 2403 0.0 0.0 4328 772 pts/0 T 20:36 0:00 fdisk /dev/sdb
root 2426 0.0 0.0 4328 772 pts/0 T 20:40 0:00 fdisk /dev/sdb
root 2437 0.0 0.3 49892 3580 ? Sl 20:42 0:00 /usr/bin/gnome-
root 2447 0.0 1.0 50004 10776 ? Ssl 20:42 0:00 gnome-session
root 2455 0.0 0.0 3628 764 ? S 20:42 0:00 dbus-launch --s
root 2456 0.0 0.1 13636 1512 ? Ssl 20:42 0:00 /bin/dbus-daemo
root 2470 0.0 0.4 8676 4160 ? S 20:42 0:00 /usr/libexec/gc
root 2479 0.0 0.9 125964 9344 ? Ssl 20:42 0:00 /usr/libexec/gn
root 2480 0.0 0.7 28080 7860 ? Ss 20:42 0:00 seahorse-daemon
root 2485 0.0 0.1 7748 1972 ? S 20:42 0:00 /usr/libexec/gv
root 2489 0.0 0.2 39200 2564 ? Ssl 20:42 0:00 /usr/libexec//g
root 2496 0.0 1.1 118300 12100 ? Sl 20:42 0:00 metacity
root 2507 0.0 1.2 45996 13216 ? S 20:42 0:00 gnome-panel
root 2508 0.0 1.8 74096 19048 ? S 20:42 0:00 nautilus
root 2510 0.0 0.2 41856 3000 ? Ssl 20:42 0:00 /usr/libexec/bo
root 2516 0.0 0.3 8604 3152 ? S 20:42 0:00 /usr/libexec/gv
root 2521 0.0 1.0 44616 11268 ? S 20:42 0:00 /usr/libexec/wn
root 2522 0.0 0.9 43192 9544 ? S 20:42 0:00 /usr/libexec/tr
root 2524 0.0 0.2 6496 2664 ? S 20:42 0:00 /usr/libexec/ud
root 2525 0.0 0.0 6260 600 ? S 20:42 0:00 udisks-daemon:
root 2527 0.0 0.2 8240 2864 ? S 20:42 0:00 /usr/libexec/gv
root 2529 0.0 0.2 8652 2312 ? S 20:42 0:00 /usr/libexec/gv
root 2531 0.0 0.1 21756 1944 ? Sl 20:42 0:00 /usr/libexec/gv
root 2538 0.0 1.7 69408 18420 ? S 20:42 0:00 /usr/bin/gnote
root 2541 0.0 0.8 27336 8352 ? S 20:42 0:00 /usr/libexec/no
root 2542 0.0 1.0 55800 11196 ? S 20:42 0:00 /usr/libexec/gd
root 2544 0.0 1.3 49112 13676 ? S 20:42 0:00 /usr/libexec/cl
root 2554 0.2 2.2 72304 23668 ? S 20:42 0:03 /usr/lib/vmware
root 2568 0.0 0.6 21020 6732 ? S 20:42 0:00 /usr/libexec/gd
root 2572 0.0 0.8 36252 8480 ? S 20:42 0:00 bluetooth-apple
root 2574 0.0 0.7 21232 7276 ? S 20:42 0:00 gnome-power-man
root 2575 0.0 1.0 55560 10344 ? S 20:42 0:00 nm-applet --sm-
root 2577 0.1 0.4 102480 4576 ? S<sl 20:42 0:01/usr/bin/pulsea
root 2578 0.0 0.5 19912 5688 ? S 20:42 0:00 /usr/libexec/po
root 2579 0.0 1.0 107724 10620 ? S 20:42 0:00 gnome-volume-co
root 2580 0.0 1.4 32568 14452 ? S 20:42 0:00 python /usr/sha
root 2581 0.0 1.0 121384 10712 ? Sl 20:42 0:00 gpk-update-icon
root 2584 0.0 0.2 11972 2504 ? S 20:42 0:00 /usr/libexec/pu
root 2585 0.0 1.2 16252 12660 ? Ss 20:42 0:00 /usr/sbin/resto
root 2607 0.0 0.5 21688 5564 ? Ss 20:42 0:00 gnome-screensav
root 2612 0.1 1.1 51928 12072 ? Sl 20:42 0:01 gnome-terminal
root 2628 0.0 0.0 2076 620 ? S 20:42 0:00 gnome-pty-helpe
root 2630 0.0 0.1 5260 1652 pts/1 Ss+ 20:42 0:00 bash
root 2651 0.0 0.2 7780 2304 ? S 20:42 0:00 /usr/libexec/gv
root 2711 0.0 0.0 0 0 ? S 20:46 0:00 [jbd2/sdb1-8]
root 2712 0.0 0.0 0 0 ? S 20:46 0:00 [ext4-dio-unwr]
root 2899 0.0 0.0 12788 604 ? S 21:05 0:00 tpvmlpd2
root 2900 0.0 0.1 4936 1048 pts/0 R+ 21:05 0:00 ps aux
[root@localhost pub]#ps aux |head -5
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 1 0.0 0.1 2900 1436 ? Ss 20:17 0:01 /sbin/init
root 2 0.0 0.0 0 0 ? S 20:17 0:00 [kthreadd]
root 3 0.0 0.0 0 0 ? S 20:17 0:00 [migration/0]
root 4 0.0 0.0 0 0 ? S 20:17 0:00 [ksoftirqd/0]
S-进程可中断的睡眠模式 Ss+前台的进程组
s-绘画,后台的进程组 R- 正在运行的进程
N-表示进程的优先级为低 Z-僵尸进程,杀不死的进程
S<s表示高优先级
Sl 多线程
查看进程树:pstree命令
[root@localhostpub]# pstree
init─┬─NetworkManager─┬─dhclient
│ └─{NetworkManager}
├─abrtd
├─acpid
├─atd
├─auditd───{auditd}
├─bluetoothd
├─bonobo-activati───{bonobo-activat}
├─clock-applet
├─console-kit-dae───63*[{console-kit-da}]
├─crond
├─cupsd
├─2*[dbus-daemon───{dbus-daemon}]
├─2*[dbus-launch]
├─devkit-power-da
├─gconfd-2
├─gdm-binary─┬─gdm-simple-slav─┬─Xorg
│ │ ├─gdm-session-wor─┬─gnome-session─┬─bluetooth-apple
│ │ │ │ ├─gdu-notificatio
│ │ │ │ ├─gnome-panel
│ │ │ │ ├─gnome-power-man
│ │ │ │ ├─gnome-volume-co
│ │ │ │ ├─gpk-update-icon──+
│ │ │ │ ├─metacity───{metac+
│ │ │ │ ├─nautilus
│ │ │ │ ├─nm-applet
│ │ │ │ ├─polkit-gnome-au
│ │ │ │ ├─python
│ │ │ │ └─{gnome-session}
│ │ │ └─{gdm-session-wo}
│ │ └─{gdm-simple-sla}
│ └─{gdm-binary}
├─gdm-user-switch
├─gnome-keyring-d───2*[{gnome-keyring-}]
├─gnome-screensav
├─gnome-settings-───{gnome-settings}
├─gnome-terminal─┬─bash
│ ├─gnome-pty-helpe
│ └─{gnome-terminal}
├─gnote
├─gvfs-afc-volume───{gvfs-afc-volum}
├─gvfs-fuse-daemo───3*[{gvfs-fuse-daem}]
├─gvfs-gdu-volume
├─gvfs-gphoto2-vo
├─gvfsd
├─gvfsd-burn
├─gvfsd-trash
├─hald─┬─hald-runner─┬─hald-addon-acpi
│ │ ├─hald-addon-inpu
│ │ └─hald-addon-rfki
│ └─{hald}
├─master─┬─pickup
│ └─qmgr
├─5*[mingetty]
├─modem-manager
├─notification-ar
├─polkitd
├─pulseaudio─┬─gconf-helper
│ └─2*[{pulseaudio}]
├─restorecond
├─rsyslogd───3*[{rsyslogd}]
├─rtkit-daemon───2*[{rtkit-daemon}]
├─seahorse-daemon
├─sshd───sshd───bash─┬─2*[fdisk]
│ └─pstree
├─tpvmlp
├─trashapplet
├─udevd───2*[udevd]
├─udisks-daemon───udisks-daemon
├─vmtoolsd───{vmtoolsd}
├─vmtoolsd
├─vmware-vmblock-───2*[{vmware-vmblock}]
├─wnck-applet
└─wpa_supplicant
命令top,可是实时的反应系统的进程。
[root@localhost pub]#top
top - 23:51:16 up 3:33, 3 users, load average: 0.00,0.00, 0.00
Tasks: 143total, 1 running, 140 sleeping, 2 stopped, 0 zombie(僵尸进程)
Cpu(s): 0.3%us, 0.3%sy, 0.0%ni, 99.3%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Mem: 1030528k total, 500004k used, 530524k free, 31772k buffers(缓存)
Swap: 2064376k total, 0k used, 2064376k free, 287092k cached
(swap是交换分区,物理内存的1-2倍,还少于8个G)
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
2554 root 20 0 72304 23m 18m S 0.3 2.3 0:15.32 vmtoolsd
3796 root 20 0 2704 1124 868 R 0.3 0.1 0:00.32 top
1 root 20 0 2900 1436 1216 S 0.0 0.1 0:01.81 init
2 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kthreadd
3 root RT 0 0 0 0 S 0.0 0.0 0:00.00 migration/0
4 root 20 0 0 0 0 S 0.0 0.0 0:00.08 ksoftirqd/0
5 root RT 0 0 0 0 S 0.0 0.0 0:00.00 migration/0
6 root RT 0 0 0 0 S 0.0 0.0 0:00.16 watchdog/0
7 root 20 0 0 0 0 S 0.0 0.0 0:00.64 events/0
8 root 20 0 0 0 0 S 0.0 0.0 0:00.00 cgroup
9 root 20 0 0 0 0 S 0.0 0.0 0:00.00 khelper
10 root 20 0 0 0 0 S 0.0 0.0 0:00.00 netns
11 root 20 0 0 0 0 S 0.0 0.0 0:00.00 async/mgr
PID是进程的ID,VIRT是分配的内存,RES是实际占有的内存
PR-内存调度的优先级,不能直接调整,通过调整NI的值,来影响PR的值。
管理进程
[root@localhost pub]#kill –l(查看进程信号量)
1) SIGHUP 2) SIGINT 3) SIGQUIT 4) SIGILL 5) SIGTRAP
6) SIGABRT 7) SIGBUS 8) SIGFPE 9) SIGKILL 10) SIGUSR1
11)SIGSEGV 12) SIGUSR2 13) SIGPIPE 14) SIGALRM 15) SIGTERM
16)SIGSTKFLT 17) SIGCHLD 18) SIGCONT 19) SIGSTOP 20) SIGTSTP
21)SIGTTIN 22) SIGTTOU 23) SIGURG 24) SIGXCPU 25) SIGXFSZ
26)SIGVTALRM 27) SIGPROF 28)SIGWINCH 29) SIGIO 30) SIGPWR
31)SIGSYS 34) SIGRTMIN 35) SIGRTMIN+1 36) SIGRTMIN+2 37) SIGRTMIN+3
38)SIGRTMIN+4 39) SIGRTMIN+5 40) SIGRTMIN+6 41) SIGRTMIN+7 42) SIGRTMIN+8
43)SIGRTMIN+9 44) SIGRTMIN+10 45)SIGRTMIN+11 46) SIGRTMIN+12 47) SIGRTMIN+13
48)SIGRTMIN+14 49) SIGRTMIN+15 50) SIGRTMAX-14 51) SIGRTMAX-13 52) SIGRTMAX-12
53)SIGRTMAX-11 54) SIGRTMAX-10 55) SIGRTMAX-9 56) SIGRTMAX-8 57) SIGRTMAX-7
58)SIGRTMAX-6 59) SIGRTMAX-5 60) SIGRTMAX-4 61) SIGRTMAX-3 62) SIGRTMAX-2
63)SIGRTMAX-1 64) SIGRTMAX
1) 1) SIGHUP 运动员,跑错了跑道,裁判告诉你跑错了,重新开始。
2) 9) SIGKILL 运动员,跑错了跑道,裁判告诉你别跑了,强制停止。
3) 15) SIGTERM 运动员,跑错了跑道,裁判告诉你跑错了,裁判比较阴险,不管你,正常结束。
[root@guohuiqiang yp]# kill -9 1123(1123是进程的id)
-bash:kill: (1123) - No such process
[root@guohuiqiang yp]# killall mysqld(mysqld是进程的名字)
mysqld:no process killed
[root@localhost /]# ls
aming.log etc lost+found opt public srv tmp
bin guohuiqiang mbr passwd root strong usr
boot home media proc sbin strong[root@localhost var
dev lib mnt pub selinux sys
有lost+found 表示是个单独的分区,是个回收站。
[root@guohuiqiang /]# cd /boot
[root@guohuiqiang boot]# ls
aming_soft lost+found
config-2.6.32-431.el6.i686 symvers-2.6.32-431.el6.i686.gz
efi System.map-2.6.32-431.el6.i686
grub vmlinuz-2.6.32-431.el6.i686
initramfs-2.6.32-431.el6.i686.img
进程的前后台怎么切换?
[root@guohuiqiang ~]#sleep 600 &(加&,把进程放到后台)
[1] 2906
查看后台进程 jobs命令能够
[root@guohuiqiang ~]# jobs
[1]+ Running sleep 600 &
Ctrl+Z把前台的进程放到后台,并且是stop的状态
[root@guohuiqiang ~]#fg %1 后台放到前台
sleep 600
^Z
[1]+ Stopped sleep 600
如何启动后台进程“??
[root@guohuiqiang ~]# bg %1
[1]+ sleep 600 &
[1]+ Done sleep 600
2. 计划任务管理
计划任务用来干啥?(类似闹钟)
一次性计划任务 命令是at
[root@guohuiqiang ~]#at
Garbled time
[root@guohuiqiang ~]#/etc/init.d/atd status (服务是开启的才行,)
atd (pid 2048) is running...
周期性计划任务
[root@guohuiqiang ~]# cron
-bash: cron:command not found
表示crontab 没有安装
http://www.111cn.net/sys/linux/62413.htm
按照上述链接给的操作,安装crontab
[root@guohuiqiang ~]#yum install -y vixie-cron
Loaded plugins: fastestmirror,refresh-packagekit, security
Loading mirror speeds from cachedhostfile
* base: ftp.sjtu.edu.cn
* extras: ftp.sjtu.edu.cn
* updates: ftp.sjtu.edu.cn
base | 3.7 kB 00:00
extras | 3.4 kB 00:00
updates | 3.4 kB 00:00
Setting up Install Process
^XResolving Dependencies
--> Running transaction check
---> Package cronie.i6860:1.4.4-12.el6 will be updated
--> Processing Dependency: cronie= 1.4.4-12.el6 for package: cronie-anacron-1.4.4-12.el6.i686
---> Package cronie.i6860:1.4.4-15.el6 will be an update
--> Running transaction check
---> Packagecronie-anacron.i686 0:1.4.4-12.el6 will be updated
---> Packagecronie-anacron.i686 0:1.4.4-15.el6 will be an update
--> Finished DependencyResolution
Dependencies Resolved
=============================================================================================
Package Arch Version Repository Size
=============================================================================================
Updating:
cronie i686 1.4.4-15.el6 base 73 k
Updating for dependencies:
cronie-anacron i686 1.4.4-15.el6 base 30 k
Transaction Summary
=============================================================================================
Upgrade 2 Package(s)
Total download size: 104 k
Downloading Packages:
(1/2):cronie-1.4.4-15.el6.i686.rpm | 73 kB 00:00
(2/2):cronie-anacron-1.4.4-15.el6.i686.rpm | 30 kB 00:00
---------------------------------------------------------------------------------------------
Total 881 kB/s | 104 kB 00:00
warning: rpmts_HdrFromFdno:Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY
Retrieving key fromfile:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
Importing GPG key 0xC105B9DE:
Userid : CentOS-6 Key (CentOS 6 OfficialSigning Key) <centos-6-key@centos.org>
Package:centos-release-6-5.el6.centos.11.1.i686(@anaconda-CentOS-201311271240.i386/6.5)
From :/etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Updating :cronie-anacron-1.4.4-15.el6.i686 1/4
Updating :cronie-1.4.4-15.el6.i686 2/4
Cleanup :cronie-anacron-1.4.4-12.el6.i686 3/4
Cleanup :cronie-1.4.4-12.el6.i686 4/4
Verifying : cronie-1.4.4-15.el6.i686 1/4
Verifying :cronie-anacron-1.4.4-15.el6.i686 2/4
Verifying :cronie-anacron-1.4.4-12.el6.i686 3/4
Verifying :cronie-1.4.4-12.el6.i686 4/4
Updated:
cronie.i686 0:1.4.4-15.el6
Dependency Updated:
cronie-anacron.i686 0:1.4.4-15.el6
Complete!
安装完之后
[root@guohuiqiang ~]# crontab -l
no crontabfor root
解决办法:
1、登录到root用户。
2、在root下输入:crontab -e
3、可能会提示你:
no crontab for root - using anempty one
然后会叫你“Selecta editor ......”下面有几个选项,就是叫你选择编辑器。(选vim.tiny)
或直接进入编辑页面。
4、进入crontab编辑页面之后就直接"shift+:",然后输入wq保存即可。然后一个新的crontab就生成了!
[root@guohuiqiang ~]# crontab -l
[root@guohuiqiang ~]# cron
crond crontab
[root@guohuiqiang~]# /etc/init.d/crond status (状态开启)
crond(pid 3597) is running...
[root@guohuiqiang ~]#man 5 crontab
EXAMPLE CRON FILE
# use /bin/sh to run commands, no matterwhat /etc/passwd says
SHELL=/bin/sh
# mail any output to ‘paul’, no matterwhose crontab this is
MAILTO=paul
#
×××××分,时,日
CRON_TZ=Japan
# run five minutes after midnight, everyday
5 0 * * * $HOME/bin/daily.job >>$HOME/tmp/out 2>&1
# run at 2:15pm on the first of everymonth -- output mailed to paul
15 14 1 * * $HOME/bin/monthly
# run at 10 pm on weekdays, annoy Joe
0 22 * * 1-5 mail -s "It’s 10pm"joe%Joe,%%Where are your kids?%
23 0-23/2 * * * echo "run 23 minutesafter midn, 2am, 4am ..., everyday"
5 4 * * sun echo "run at 5 after 4 everysunday"
每5分钟执行一遍:
*/5* * * *
[root@guohuiqiang ~]# crontab -u
crontab: option requires anargument -- 'u'
crontab: usage error:unrecognized option
usage: crontab [-u user] file
crontab [-u user] [ -e | -l | -r ]
(default operation is replace,per 1003.2)
-e (edit user's crontab)
-l (list user's crontab)
-r (delete user's crontab)
-i (prompt before deleting user's crontab)
-s (selinux context)
Archiver|手机版|科学网 ( 京ICP备07017567号-12 )
GMT+8, 2024-9-28 03:25
Powered by ScienceNet.cn
Copyright © 2007- 中国科学报社