日志管理

标签: 日志 管理 | 发表时间:2013-09-01 17:17 | 作者:Wentasy
出处:http://blog.csdn.net

一 日志相关文件

#很关键
[root@client01 ~]# ls /var/log/
anaconda.ifcfg.log    anaconda.xlog      btmp           dmesg       maillog            secure            wtmp
anaconda.log          anaconda.yum.log   btmp-20130805  dmesg.old  maillog-20130805  secure-20130805   yum.log
anaconda.program.log  audit              ConsoleKit     dracut.log messages           spooler
anaconda.storage.log  boot.log           cron          httpd       messages-20130805  spooler-20130805
anaconda.syslog       boot.log-20130805  cron-20130805 lastlog     rhsm               tallylog
 
#关键日志,大部分记录在里面
[root@client01 ~]# ls /var/log/messages
/var/log/messages
      
#系统启动,硬件相关日志
[root@client01 ~]# ls /var/log/dmesg*
/var/log/dmesg  /var/log/dmesg.old
 
#登录安全相关日志
[root@client01 ~]# ls /var/log/secure
/var/log/secure
 
#使用ssh登录,输入错误密码
[root@larrywen opt]# ssh 192.168.1.11
root@192.168.1.11's password:
Permission denied, please try again.
root@192.168.1.11's password:
Permission denied, please try again.
 
#监控文件,可以看到刚才输入的错误密码已经记录下来了
[root@client01 ~]# tail -f /var/log/secure
[root@client01 ~]# tail -n 4/var/log/secure
Aug 5 14:46:13 client01 sshd[2796]: pam_unix(sshd:auth): authenticationfailure; logname= uid=0 euid=0 tty=ssh ruser= rhost=192.168.1.1  user=root
Aug 5 14:46:15 client01 sshd[2796]: Failed password for root from192.168.1.1 port 50116 ssh2
Aug 5 14:46:23 client01 unix_chkpwd[2800]: password check failed for user(root)
Aug 5 14:46:25 client01 sshd[2796]: Failed password for root from192.168.1.1 port 50116 ssh2
 
#邮件相关日志
[root@larrywen opt]# ls /var/log/maillog
/var/log/maillog
 
#登录信息日志
[root@client01 ~]# ls /var/log/lastlog
#最后登录的信息
[root@client01 ~]# ls /var/log/lastlog
/var/log/lastlog
[root@client01 ~]# last
#最后登录错误的信息
[root@client01 ~]# lastb
 
#SELINUX相关日志
[root@client01 ~]# ls /var/log/audit/
audit.log
 
[root@client01 ~]# ls /var/log/maillog*
/var/log/maillog  /var/log/maillog-20130805
#之前日志的备份,一个星期切换一次,会自动备份
maillog-20130805
 
[root@larrywen 0805]# ls /var/log/maillog*
/var/log/maillog  /var/log/maillog-20130729  /var/log/maillog-20130805
[root@larrywen 0805]# ls /var/log/boot.log*
/var/log/boot.log  /var/log/boot.log-20130729  /var/log/boot.log-20130805

二 日志相关服务

[root@client01 ~]# ps -ef|grep log
#系统日志服务
root      959     1  0 08:49 ?        00:00:00 /sbin/rsyslogd -c 4
root     1133     1  0 08:49 ?        00:00:00 login -- root    
root     2811  2776  0 14:54 pts/0    00:00:00 grep log
 
[root@client01 ~]# /etc/init.d/rsyslogrestart
Shutting down system logger:                               [  OK  ]
Starting system logger:                                    [  OK  ]
 
 
#rsyslog:日志记录的位置,指定输出文件
#日志级别:Debug Warning

三 实验:日志转移(一台机器的日志备份到另一台机器)

 

client01:

[root@client01 ~]# ls /etc/*log*
/etc/csh.login  /etc/login.defs  /etc/logrotate.conf  /etc/rsyslog.conf
 
/etc/logrotate.d:
dracut httpd  subscription-manager  syslog up2date  yum
[root@client01 ~]# ls /etc/rsyslog.conf
/etc/rsyslog.conf
[root@client01 ~]# vim /etc/rsyslog.conf
 
#模块:实现某个功能的程序
 
#不要急着写,支持异步写。等到一定量的时候才写,延迟写(负号的含义)
-/var/log/maillog
 
#修改文件
[root@client01 ~]# vim /etc/rsyslog.conf
 
[root@client01 ~]# grep "hongyi"/etc/rsyslog.conf -n
60:local3.*                                      /var/log/hongyi.log
#重启服务
[root@client01 ~]# /etc/init.d/rsyslogrestart
Shutting down system logger:                               [  OK  ]
Starting system logger:                                    [  OK  ]
#可以查看到生成了这个文件
[root@client01 ~]# ls /var/log/hongyi.log
/var/log/hongyi.log
#写日志
[root@client01 ~]# logger -p"local3.info" "this is test"
[root@client01 ~]# cat /var/log/hongyi.log
Aug 5 15:17:00 client01 root: this is test
#我们写local2.info,发现没有记录
[root@client01 ~]# logger -p"local2.info" "this is test"
[root@client01 ~]# cat /var/log/hongyi.log
Aug 5 15:17:00 client01 root: this is test
 
[root@client01 ~]# logger --help
logger: invalid option -- '-'
usage: logger [-is] [-f file] [-p pri] [-ttag] [-u socket] [ message ... ]
 
#性能
 
#一台机器上的文件保存到另一台机器上
[root@serv02 ~]# grep "UDP" /etc/rsyslog.conf  -n -A1
12:# Provides UDP syslog reception
13-$ModLoad imudp.so
14:$UDPServerRun 514
15-
[root@serv02 ~]# grep "local3.*"/etc/rsyslog.conf  -n
59:local3.*                                      /tmp/up.log
[root@larrywen 0805]# man rsyslog.conf

serv01:

#rsyslog.conf做如下配置
[root@serv01 ~]# grep local3/etc/rsyslog.conf -n
#192.168.1.12是serv02的IP
#@:UDP 服务
#@@:TCP服务
60:local3.*     @192.168.1.12
#重启服务
[root@serv01 ~]# /etc/init.d/rsyslogrestart
Shutting down system logger:                               [  OK  ]
Starting system logger:                                    [  OK  ]
#Serv02配置完后,输出日志到第二台机器
[root@serv01 ~]# logger -p"local3.info" "hello,world"


serv02:

#rsyslog.conf文件做如下配置
[root@serv02 ~]# cat -n/etc/rsyslog.conf|sed "8,9p;/local3/p"  -n
    8  $ModLoad imuxsock.so    # provides support for local system logging(e.g. via logger command)
    9  $ModLoad imklog.so # provides kernel logging support (previouslydone by rklogd)
59   local3.*     /tmp/up.log
#重启服务
[root@serv02 ~]# /etc/init.d/rsyslogrestart
Shutting down system logger:                               [  OK  ]
Starting system logger:                                    [  OK  ]
#查看文件可以看到
[root@serv02 ~]# cat /tmp/up.log
Aug 5 15:31:38 serv01 root: hello,world
 
#日志备份

四 定时计划任务

[root@client01 ~]# yum install at -y
[root@client01 ~]# at now +3 minutes
at> echo "hello,wolrd" >/opt/aa01.txt
at> <EOT>
job 2 at 2013-08-05 16:20
Can't open /var/run/atd.pid to signal atd.No atd running?
[root@client01 ~]# /etc/init.d/atd start
Starting atd:                                              [  OK  ]
#相对当前时间
[root@client01 ~]# at now +3 minutes
at> echo "hello,wolrd" >/opt/aa01.txt
at> <EOT>
job 3 at 2013-08-05 16:21
[root@client01 ~]# at -l
3     2013-08-0516:21 a root:  
2     2013-08-0516:20 a root
root@client01 opt]# ll
total 20
-rw-r--r--. 1 root root    12 Aug 5 16:20 aa01.txt
drwx------. 2 root root 16384 Jul 23 00:54lost+found
 
#支持分钟 小时 天
[root@client01 ~]# at now +1 days
 
 
[root@client01 opt]# at 16:28 08/05/2013
at> echo "hello,uplooking"> /opt/aa02.txt
at> <EOT>
job 4 at 2013-08-05 16:28
[root@client01 opt]# at -l
4     2013-08-0516:28 a root
 
[root@client01 opt]# at 18:20 08/06/2013
at> rm -rf /*<EOT>
job 5 at 2013-08-06 18:20
[root@client01 opt]# at -l
5     2013-08-0618:20 a root
4     2013-08-0516:28 a root
 
[root@client01 opt]# at --help
at: invalid option -- '-'
Usage: at [-V] [-q x] [-f file] [-mldbv]time
      at -c job ...
      atq [-V] [-q x]
      atrm [-V] job ...
      batch
#移除
[root@client01 opt]# atrm 5
#列出详细的任务
[root@client01 opt]# at -l
4     2013-08-0516:28 a root
 
#执行完后自动清除,本次有效
 
#crontab:循环有效
[root@client01 opt]# vim /etc/crontab
   ** * * * echo `date` >> /opt/aa03.txt
#添加规则
[root@client01 opt]# crontab -e
no crontab for root - using an empty one
crontab: installing new crontab
 
30 18 * * * init 0
1 */2 10-20 7,8 5 wall "Have aholiday"
#列出所有的任务
[root@client01 opt]# crontab -l
* * * * * echo `date` >>/opt/aa03.txt
30 18 * * * init 0
[root@client01 opt]# crontab --help
crontab: invalid option -- '-'
crontab: usage error: unrecognized option
usage:    crontab[-u user] file
       crontab[-u user] [ -e | -l | -r ]
              (defaultoperation 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)
 
#查看编写的文件
[root@client01 opt]# cd /var/spool/
[root@client01 spool]# ls
anacron at  cron  lpd mail  plymouth  postfix up2date
[root@client01 spool]# cd cron/
[root@client01 cron]# ll
total 4
-rw-------. 1 root root 58 Aug  5 16:37 root
[root@client01 cron]# cat root
* * * * * echo `date` >>/opt/aa03.txt
30 18 * * * init 0
[root@client01 cron]# cd /etc/cron.
cron.d/       cron.daily/   cron.deny    cron.hourly/  cron.monthly/cron.weekly/
      
#每天执行的
[root@client01 cron]# cat/etc/cron.d/0hourly
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/
01 * * * * root run-parts /etc/cron.hourly
 
#每个小时执行的
[root@client01 cron]# cat/etc/cron.hourly/0anacron
#!/bin/bash
#in case file doesn't exist
if test -r /var/spool/anacron/cron.daily;then
   day=`cat /var/spool/anacron/cron.daily`
fi
if [ `date +%Y%m%d` = "$day" ];then
   exit 0;
fi
 
# in case anacron is already running,
# there will be log (daemon won't berunning twice).
if test -x /usr/bin/on_ac_power; then
   /usr/bin/on_ac_power &> /dev/null
   if test $? -eq 1; then
   exit 0
   fi
fi
/usr/sbin/anacron -s
 
#查看每天执行的配置文件
[root@client01 cron]# cat/etc/cron.daily/logrotate
#!/bin/sh
 
/usr/sbin/logrotate /etc/logrotate.conf>/dev/null 2>&1
EXITVALUE=$?
if [ $EXITVALUE != 0 ]; then
   /usr/bin/logger -t logrotate "ALERT exited abnormally with[$EXITVALUE]"
fi
exit 0
 
#查看syslog文件,可以看到日志的创建过程
[root@client01 logrotate.d]# cat syslog
/var/log/messages /var/log/secure/var/log/maillog /var/log/spooler /var/log/boot.log /var/log/cron {
   sharedscripts
   postrotate
       /bin/kill-HUP `cat /var/run/syslogd.pid 2> /dev/null` 2> /dev/null || true
   endscript
}
 
#可以对日志的相关文件进行配置
[root@client01 cron]# cat/etc/logrotate.conf
# see "man logrotate" for details
# rotate log files weekly
weekly
 
# keep 4 weeks worth of backlogs
rotate 4
 
# create new (empty) log files afterrotating old ones
create
 
# use date as a suffix of the rotated file
dateext
 
# uncomment this if you want your log filescompressed
#compress
 
# RPM packages drop log rotationinformation into this directory
include /etc/logrotate.d
 
# no packages own wtmp and btmp -- we'llrotate them here
/var/log/wtmp {
   monthly
   create 0664 root utmp
       minsize1M
   rotate 1
}
 
/var/log/btmp {
   missingok
   monthly
   create 0600 root utmp
   rotate 1
}
 
# system-specific logs may be also beconfigured here.

五 模拟日志文件的拷贝

#从man中进行示例的拷贝
[root@client01 logrotate.d]# manlogrotate.conf
 
#编辑文件
[root@client01 logrotate.d]# vim/etc/logrotate.conf
[root@client01 logrotate.d]# cat/etc/logrotate.conf
/opt/hongyi.log {
   monthly
   rotate 2
   olddir /opt/old
   missingok
   create 0600 root hongyi
   nocompress
}
#创建用户
[root@client01 logrotate.d]# useradd hongyi
#创建目录
[root@client01 logrotate.d]# mkdir /opt/old
#创建文件
[root@client01 logrotate.d]# touch/opt/hongyi.log
#编辑文件
[root@client01 logrotate.d]# vim/opt/hongyi.log
[root@client01 logrotate.d]# ls /opt
aa03.txt hongyi.log  old
 
[root@client01 logrotate.d]# logrotate--help
Usage: logrotate [OPTION...]<configfile>
  -d,--debug               Don't do anything,just test (implies -v)
  -f,--force               Force file rotation
  -m,--mail=command        Command to sendmail (instead of `/bin/mail')
  -s,--state=statefile     Path of state file
  -v,--verbose             Display messagesduring rotation
 
Help options:
  -?,--help                Show this helpmessage
 —usage                   Displaybrief usage message
#强制使配置文件生效
[root@client01 logrotate.d]# logrotate -f/etc/logrotate.conf
[root@client01 logrotate.d]# ls /opt
aa03.txt hongyi.log  old
#可以看到已经生成了文件
[root@client01 logrotate.d]# ls /opt/old/
hongyi.log-20130805
#日志轮寻
#日志切换
 
[root@client01 ~]# ls /etc/cron.d
cron.d/    cron.daily/ cron.deny
#查看每天切换的 
[root@client01 ~]# ls /etc/cron.daily/
logrotate makewhatis.cron  rhsm-complianced
[root@client01 ~]# cat/etc/cron.daily/logrotate
#!/bin/sh
 
/usr/sbin/logrotate /etc/logrotate.conf>/dev/null 2>&1
EXITVALUE=$?
if [ $EXITVALUE != 0 ]; then
   /usr/bin/logger -t logrotate "ALERT exited abnormally with[$EXITVALUE]"
fi
exit 0
[root@client01 ~]# cat /etc/logrotate.conf
# see "man logrotate" for details
# rotate log files weekly
weekly
 
# keep 4 weeks worth of backlogs
rotate 4
 
# create new (empty) log files afterrotating old ones
create
 
# use date as a suffix of the rotated file
dateext
 
# uncomment this if you want your log filescompressed
#compress
 
# RPM packages drop log rotationinformation into this directory
include /etc/logrotate.d
 
# no packages own wtmp and btmp -- we'llrotate them here
/var/log/wtmp {
   monthly
   create 0664 root utmp
       minsize1M
   rotate 1
}
 
/var/log/btmp {
   missingok
   monthly
   create 0600 root utmp
   rotate 1
}
 
/opt/hongyi.log {
   monthly
   rotate 2
   olddir /opt/old
   missingok
   create 0600 root hongyi
   nocompress
}
 
# system-specific logs may be also beconfigured here.
[root@client01 ~]# cd /etc/lo
localtime       login.defs      logrotate.conf  logrotate.d/   
[root@client01 ~]# cd /etc/logrotate.d/
[root@client01 logrotate.d]# ll
total 24
-rw-r--r--. 1 root root 103 Apr 27  2011 dracut
-rw-r--r--. 1 root root 185 Jun 24  2010 httpd
-rw-r--r--. 1 root root  71 May 5  2011 subscription-manager
-rw-r--r--. 1 root root 228 May 20  2009 syslog
-rw-r--r--. 1 root root  32 Apr 8  2010 up2date
-rw-r--r--. 1 root root 100 Apr 29  2011 yum
 
#程序切换 日志切换
#日志:很重要
      
#设置日期
[root@client01 opt]# date -s"2013-08-07"
Wed Aug 7 00:00:00 CST 2013
#强制使文件生效,v显示过程
[root@client01 opt]# logrotate -fv/etc/logrotate.conf
reading config file /etc/logrotate.conf
including /etc/logrotate.d
reading config file dracut
reading config info for /var/log/dracut.log
reading config file httpd
reading config info for /var/log/httpd/*log
reading config file subscription-manager
reading config info for /var/log/rhsm/*.log
reading config file syslog
reading config info for /var/log/messages/var/log/secure /var/log/maillog /var/log/spooler /var/log/boot.log/var/log/cron
reading config file up2date
reading config info for /var/log/up2date
reading config file yum
reading config info for /var/log/yum.log
reading config info for /var/log/wtmp
reading config info for /var/log/btmp
reading config info for /opt/hongyi.log
olddir is now /opt/old
 
Handling 9 logs
 
rotating pattern: /var/log/dracut.log  forced from command line (4 rotations)
empty log files are not rotated, old logsare removed
considering log /var/log/dracut.log
  logdoes not need rotating
 
rotating pattern: /var/log/httpd/*log  forced from command line (4 rotations)
empty log files are not rotated, old logsare removed
considering log /var/log/httpd/access_log
  logdoes not need rotating
considering log /var/log/httpd/error_log
  logdoes not need rotating
not running postrotate script, since nologs were rotated
 
rotating pattern: /var/log/rhsm/*.log  forced from command line (4 rotations)
empty log files are not rotated, old logsare removed
considering log /var/log/rhsm/rhsmcertd.log
  logdoes not need rotating
considering log /var/log/rhsm/rhsm.log
  logdoes not need rotating
 
rotating pattern: /var/log/messages/var/log/secure /var/log/maillog /var/log/spooler /var/log/boot.log/var/log/cron  forced from command line(4 rotations)
empty log files are rotated, old logs areremoved
considering log /var/log/messages
  logneeds rotating
considering log /var/log/secure
  logneeds rotating
considering log /var/log/maillog
  logneeds rotating
considering log /var/log/spooler
  logneeds rotating
considering log /var/log/boot.log
  logneeds rotating
considering log /var/log/cron
  logneeds rotating
rotating log /var/log/messages,log->rotateCount is 4
dateext suffix '-20130807'
glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
rotating log /var/log/secure,log->rotateCount is 4
dateext suffix '-20130807'
glob pattern'-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
rotating log /var/log/maillog,log->rotateCount is 4
dateext suffix '-20130807'
glob pattern'-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
rotating log /var/log/spooler,log->rotateCount is 4
dateext suffix '-20130807'
glob pattern'-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
rotating log /var/log/boot.log,log->rotateCount is 4
dateext suffix '-20130807'
glob pattern'-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
rotating log /var/log/cron,log->rotateCount is 4
dateext suffix '-20130807'
glob pattern'-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
fscreate context set to system_u:object_r:var_log_t:s0
renaming /var/log/messages to/var/log/messages-20130807
creating new /var/log/messages mode = 0600uid = 0 gid = 0
fscreate context set tosystem_u:object_r:var_log_t:s0
renaming /var/log/secure to/var/log/secure-20130807
creating new /var/log/secure mode = 0600uid = 0 gid = 0
fscreate context set tosystem_u:object_r:var_log_t:s0
renaming /var/log/maillog to/var/log/maillog-20130807
creating new /var/log/maillog mode = 0600uid = 0 gid = 0
fscreate context set tosystem_u:object_r:var_log_t:s0
renaming /var/log/spooler to/var/log/spooler-20130807
creating new /var/log/spooler mode = 0600uid = 0 gid = 0
fscreate context set tosystem_u:object_r:var_log_t:s0
renaming /var/log/boot.log to/var/log/boot.log-20130807
creating new /var/log/boot.log mode = 0644uid = 0 gid = 0
fscreate context set tosystem_u:object_r:var_log_t:s0
renaming /var/log/cron to/var/log/cron-20130807
creating new /var/log/cron mode = 0600 uid= 0 gid = 0
running postrotate script
 
rotating pattern: /var/log/up2date  forced from command line (4 rotations)
empty log files are rotated, old logs areremoved
considering log /var/log/up2date
  log/var/log/up2date does not exist -- skipping
 
rotating pattern: /var/log/yum.log  forced from command line (4 rotations)
empty log files are not rotated, old logsare removed
considering log /var/log/yum.log
  logdoes not need rotating
 
rotating pattern: /var/log/wtmp  forced from command line (1 rotations)
empty log files are rotated, only log files>= 1048576 bytes are rotated, old logs are removed
considering log /var/log/wtmp
  logneeds rotating
rotating log /var/log/wtmp,log->rotateCount is 1
dateext suffix '-20130807'
glob pattern'-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
fscreate context set to system_u:object_r:wtmp_t:s0
renaming /var/log/wtmp to/var/log/wtmp-20130807
creating new /var/log/wtmp mode = 0664 uid= 0 gid = 22
removing old log /var/log/wtmp-20130806
 
rotating pattern: /var/log/btmp  forced from command line (1 rotations)
empty log files are rotated, old logs areremoved
considering log /var/log/btmp
  logneeds rotating
rotating log /var/log/btmp,log->rotateCount is 1
dateext suffix '-20130807'
glob pattern'-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
fscreate context set to system_u:object_r:faillog_t:s0
renaming /var/log/btmp to/var/log/btmp-20130807
creating new /var/log/btmp mode = 0600 uid= 0 gid = 22
removing old log /var/log/btmp-20130806
 
rotating pattern: /opt/hongyi.log  forced from command line (2 rotations)
olddir is /opt/old, empty log files arerotated, old logs are removed
considering log /opt/hongyi.log
  logneeds rotating
rotating log /opt/hongyi.log,log->rotateCount is 2
dateext suffix '-20130807'
glob pattern'-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
fscreate context set tounconfined_u:object_r:usr_t:s0
renaming /opt/hongyi.log to/opt/old/hongyi.log-20130807
creating new /opt/hongyi.log mode = 0600uid = 0 gid = 500
removing old log/opt/old/hongyi.log-20130805
 
#可以查看old目录下的文件
[root@client01 opt]# ls old/
hongyi.log-20130806  hongyi.log-20130807
[root@client01 opt]# cat hongyi.log
#查看文件的权限
[root@client01 opt]# ll
total 8
-rw-r--r--. 1 root root   2436 Aug 7 00:01 aa03.txt
-rw-------. 1 root hongyi    0 Aug 7 00:00 hongyi.log
drwxr-xr-x. 2 root root   4096 Aug 7 00:00 old
 

六 crontab——定时任务

#延时执行,系统启动后,检测还没有执行的任务。计划任务
#什么时候启动机器,什么时候检测
[root@client01 opt]# cat /etc/anacrontab
# /etc/anacrontab: configuration file foranacron
 
# See anacron(8) and anacrontab(5) fordetails.
 
SHELL=/bin/sh
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
# the maximal random delay added to thebase delay of the jobs
RANDOM_DELAY=45
# the jobs will be started during thefollowing hours only
START_HOURS_RANGE=3-22
 
#period in days   delay in minutes   job-identifier   command
1     5     cron.daily            nicerun-parts /etc/cron.daily
7     25   cron.weekly         nicerun-parts /etc/cron.weekly
@monthly 45      cron.monthly              nice run-parts /etc/cron.monthly
 
#crontab:列出和删除
[root@client01 opt]# crontab -l
* * * * * echo `date` >>/opt/aa03.txt
30 18 * * * init 0
[root@client01 opt]# crontab --help
crontab: invalid option -- '-'
crontab: usage error: unrecognized option
usage:    crontab[-u user] file
       crontab[-u user] [ -e | -l | -r ]
              (defaultoperation 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)
[root@client01 opt]# crontab -r
[root@client01 opt]# crontab -l
no crontab for root



  我的邮箱:   wgbno27@163.com
  新浪微博:   @Wentasy27         
  微信公众平台:JustOracle(微信号:justoracle)
  数据库技术交流群:336882565(加群时验证 From CSDN XXX)
  Oracle交流讨论组:   https://groups.google.com/d/forum/justoracle
     By Larry Wen


katoon Sina  CSDN
@Wentasy 博文仅供参考,欢迎大家来访。如有错误之处,希望批评指正。原创博文如需转载请注明出处,谢谢 :) [CSDN博客]
作者:Wentasy 发表于2013-9-1 17:17:55 原文链接
阅读:107 评论:0 查看评论

相关 [日志 管理] 推荐:

日志管理

- - CSDN博客系统运维推荐文章
#很关键 [root@client01 ~]# ls /var/log/ anaconda.ifcfg.log. tallylog #关键日志,大部分记录在里面 [root@client01 ~]# ls /var/log/messages /var/log/messages. [root@client01 ~]# ps -ef|grep log #系统日志服务 root.

Ngnix 日志管理及 Shell 实现定时完成日志切割

- - 码农网
先来看看ngnix的配置文件的server段. 接下来我们解释一下默认格式的具体意思. #log_format main ‘$remote_addr(远程IP) – $remote_user(远程用户) [$time_local](访问时间) “$request”(请求方式) ‘. # ‘$status(状态302、404、401、403等) $body_bytes_sent(请求体 body 长度等) “$http_referer”(referer来源信息) ‘.

使用Spring进行统一日志管理 + 统一异常管理

- - 编程语言 - ITeye博客
统一日志和异常管理配置好后,SSH项目中,代码以往散落的log.info() 和 try..catch..finally 再也不见踪影.  * 由Spring AOP调用 输出异常信息,把程序异常抛向业务异常 .         // 在后台中输出错误异常异常信息,通过log4j输出.         // 在这里判断异常,根据不同的异常返回错误.

linux日志集中管理查看syslog-ng+splunk

- - C1G军火库
syslog-ng ,可以简单的看成取代 syslog 的的日志服务器,企业级的.目前我们使用的 syslog-ng 开源版本是启动于十年之前的 syslog-ng 项目的“直系后代”.syslog-ng可运行与“server”和“agent”模式,分别支持 UDP、可靠的TCP和加密的TLS协议.syslog 可以用来在混合复杂的环境里建立灵活的、可靠的日志服务器..

Java程序员须知的七个日志管理工具

- - ImportNew
Splunk>Storm 日志管理工具有Splunk、Sumo Logic、LogStash、GrayLog、Loggly和PaperTrails等等,数不胜数. 日志就像石油,二十多年了我们一直想摆脱它,却一直没有做到. 为了处理日益增长的数据,近年来出现了一大批分析和管理日志的工具,开发和管理人员能够借助这些工具来了解增长的数据.

SpringAOP拦截Controller,Service实现日志管理(自定义注解的方式)

- - 企业架构 - ITeye博客
         从业近二,三年了,第一次写博客,平时做做脚手架或者架构一些基础框架然后给大家使用或者自己总结翻译一些文档. 虽然是第一次但是我还是要拿Spring开刀. 希望张开涛,涛兄看到的时候不要喷我,给我一点指导.          首先我们为什么需要做日志管理,在现实的上线中我们经常会遇到系统出现异常或者问题.

向IPO进发!日志管理分析平台Sumo Logic获7500万美元F轮融资

- - 36氪
6月27日,基于云计算的日志管理分析平台Sumo Logic宣布完成7500万美元的F轮融资,进入IPO之前的冲刺阶段. 此轮投资由Sapphire Ventures领投,Accel Partners、DFJ Growth、Greylock Partners、Institutional Venture Partners、红杉资本和Sutter Hill Ventures等跟投.

Spring AOP进行日志记录,管理 (使用Spring的拦截器功能获取对action中每个方法的调用情况,在方法调用前

- - 行业应用 - ITeye博客
原文地址: http://hi.baidu.com/wolf_childer/item/f0b5b0e664252cacc10d75d1.        在java开发中日志的管理有很多种. 我一般会使用过滤器,或者是Spring的拦截器进行日志的处理. 如果是用过滤器比较简单,只要对所有的.do提交进行拦截,然后获取action的提交路径就可以获取对每个方法的调用.

日志优化

- - 互联网 - ITeye博客
在任何系统中,日志都是非常重要的组成部分,它是反映系统运行情况的重要依据,也是排查问题时的必要线索. 绝大多数人都认可日志的重要性,但是又有多少人仔细想过该怎么打日志,日志对性能的影响究竟有多大呢. 今天就让我们来聊聊Java日志性能那些事. 说到Java日志,大家肯定都会说要选择合理的日志级别、合理控制日志内容,但是这仅是万里长征第一步……哪怕一些 DEBUG级别的日志在生产环境中不会输出到文件中,也可能带来不小的开销.

管理

- - 人月神话的BLOG
对于中小企业而言现在管理上欠缺的不是人治或者说儒家佛家等东方管理思想,而真正欠缺的是西方法治的科学管理方法. 现在很多中小企业花很多钱去听什么东方管理思想的培训是误入歧途,东西方管理思想需要融合,但是基础还是科学的管理方法和模式. 而在这个里面最重要的仍然是流程管理,知识管理,质量管理,项目管理这些内容,而不是简单的纯管理.