errclear命令格式:
- # errclear
- 0315-136 Number of days is required, and must be zero or greater.
- Usage:
- errclear -J err_label_list -K err_label_list -N resource_name_list
- -R resource_type_list -S resource_class_list -T err_type_list
- -d err_class_list -i filename -m machine_id -n node_id
- -j id_list -k id_list -l seq_no_list -y filename number_of_days
- Delete error log entries in the specified list that are older than
- number_of_days specified. Number_of_days refers to the number of twenty
- four hour periods from command invocation time.
- -J list Select only error_labels in 'list'.
- -K list Select only error_labels not in 'list'.
- -N list Select only resource_names in 'list'.
- -S list Select only resource_classes in 'list'.
- -R list Select only resource_types in 'list'.
- -T list Select only error_types in 'list'.
- -d list Select only error_classes in 'list'.
- -i filename Uses the error log file specified by the filename parameter.
- -j list Select only error_ids in 'list'.
- -k list Select only error_ids not in 'list'.
- -l list Select sequence_numbers in 'list'.
- -m machine_id Delete entries for the machine id as output by uname -m.
- -n node_id Delete entries for the node id as output by uname -n.
- -y filename Uses the error record template file specified by the filename
- parameter.
- 'list' is a list of entries separated by commas.
- error_type = PERM,TEMP,PERF,PEND,UNKN,INFO
- error_class = H (HARDWARE), S (SOFTWARE), O (errlogger MESSAGES), U (UNDETERMINED)
示例:
- #errclear n
- n为0时清除所有日志,n>0 时为清除指定天数前的日志
- #errclear -d [S,O,H,U] 15
- 删除15天前的SOHU类错误日志
- #errclear -j AA8AB241 15
- 删除15天前IDENTIFIER为AA8AB241的错误日志
- #errclear -T INFO 0
- 删除所有类型为INFO的日志
转载于:https://blog.51cto.com/hunt1574/1039808