1.计划任务
1.1)at (atd服务)(注意下面的逻辑关系)
-----------------------------------------------------------------------------------
The superuser may use these commands in any case.
If the file /etc/at.allow exists, only usernames mentioned in it are allowed to use at.
If /etc/at.allow does not exist, /etc/at.deny is checked, every username not mentioned in it is then allowed to use at.
If neither exists, only the superuser is allowed use of at.
----------------------------------------------------------------------------------- 查询:
查任务:atq (at -l)
查任务内容:at -c job_id
文件位置存放:/var/spool/at (at是set uid )
1.2)cron (crond服务)(注意下面的逻辑关系)
-----------------------------------------------------------------------------------
The superuser may use these commands in any case.
If the allow file exists, then you must be listed therein in order to be allowed to use this command.
If the allow file does not exist but the deny file does exist, then you must not be listed in the deny file in order to use this command.
If neither of these files exists, then depending on site-dependent config
uration parameters, only the super user will be allowed to use this command, or all users will be able to use this command.
-----------------------------------------------------------------------------------
minute hour day month day of week command
eg. 每个工作日8:30--9:00间播放音乐(/media/mp3)
30 8 * * 1-5 mplay /media/mp3/*.mp3
0 9 * * 1-5 kill `ps -ef |grep mplay |grep -v "grep mplay" |awk '{print $2}'`
/etc/crontab 按任务定期执行下面目录中的脚本 用run-parts调用目录
=========================================================
/etc/cron.d
/etc/cron.hourly
/etc/cron.daily
/etc/cron.weekly
/etc/cron.monthly
2)系统日志
-后台进程:
syslogd
-配置文件
/etc/syslog.conf
/etc/sysconfig/syslog
2.1)syslog.conf使用格式
facility priority action
facility:
============
The facility is one of the following keywords: auth, authpriv, cron, daemon, kern, lpr, mail, mark, news,security (same as auth), syslog, user, uucp and local0 through local7.
priority:
============
The priority is one of the following keywords, in ascending order: debug, info, notice, warning, warn (same as warning), err, error (same as err), crit, alert, emerg, panic (same as emerg). The keywords error, warn and panic are deprecated and should not be used anymore. The priority defines the severity of the message
注意:* , ; = !
详见:man 5 syslog.conf
action:
============
Regular File,Named Pipes,Terminal and Console,Remote Machine,List of Users,Everyone logged on
2.2)如何启用中央日志服务器
2.2.1)修改每个工作站/etc/syslog.conf中内容
只保留一行内容 *.* @server
2.2.2)重启syslogd服务
service syslog restart
2.2.3)修改服务器上的/etc/sysconfig/syslog,开启远程访问
SYSLOGD_OPTIONS="-m 0 -r -x "
阅读(1826) | 评论(0) | 转发(0) |