errclear 명령어 (AIX 5.3·6.1)

핵심 정리

  • 오류 로그에서 Days일보다 오래된 항목을 지웁니다. errclear 0은 모든 항목을 지웁니다. root만 실행할 수 있습니다.
  • errpt와 같은 고르기 플래그를 씁니다. -d H|S|O|U(분류), -T PERM|TEMP|...(유형), -j·-J(이 ID·레이블만 지움), -k·-K(이 ID·레이블만 남기고 지움), -N 자원이름.
  • 항목을 지워도 오류 로그 파일 크기는 줄지 않습니다.
  • 지우기 전에 errpt -a > 파일로 남겨 두는 것이 좋습니다.
항목 내용
버전 AIX 5.3, AIX 6.1 (6.1 문서에 RBAC 보안 안내가 더해짐. 플래그는 같음)
원문 IBM Commands Reference — 5.3 Volume 2, 6.1 Volume 2
파일 /usr/bin/errclear, /var/adm/ras/errlog, /etc/objrepos/SWservAt
관련 명령어 errpt, errlogger, errdemon

목적

오류 로그에서 항목을 지웁니다.

영어 원문

Deletes entries from the error log.

구문

text
errclear [ -d ErrorClassList ] [ -i File ] [ -J ErrorLabel [,ErrorLabel] ] | [ -K ErrorLabel [,ErrorLabel] ]
         [ -l SequenceNumber ] [ -m Machine ] [ -n Node ] [ -N ResourceNameList ] [ -R ResourceTypeList ]
         [ -S ResourceClassList ] [ -T ErrorTypeList ] [ -y FileName ]
         [ -j ErrorID [,ErrorID] ] | [ -k ErrorID [,ErrorID] ] Days

설명

errclear 명령은 Days 매개변수로 지정한 날 수보다 오래된 오류 로그 항목을 지웁니다. 모든 항목을 지우려면 Days에 0을 줍니다.

-i를 쓰지 않으면 오류 로그 구성 데이터베이스에 지정된 오류 로그 파일을 지웁니다. 구성 데이터베이스의 내용은 errdemon 명령으로 봅니다.

참고: errclear는 지정한 항목을 지우지만 오류 로그 파일의 크기를 줄이지는 않습니다.

Web-based System Manager(wsm)의 System 응용 프로그램이나 SMIT 빠른 경로 smit errclear로도 이 명령을 실행할 수 있습니다.

영어 원문

The errclear command deletes error-log entries older than the number of days specified by the Days parameter. To delete all error-log entries, specify a value of 0 for the Days parameter.

If the -i flag is not used with the errclear command, the error log file cleared by errclear is the one specified in the error log configuration database. (To view the information in the error log configuration database, use the errdemon command.)

Note: The errclear command clears the specified entries, but does not decrease the error log file size.

You can use the System application in Web-based System Manager (wsm) to change system characteristics. You could also use the System Management Interface Tool (SMIT) smit errclear fast path to run this command.

플래그

플래그 설명
-d List 지정한 오류 분류의 항목을 지웁니다. H(하드웨어), S(소프트웨어), O(errlogger 메시지), U(알 수 없음).
-i File File을 오류 로그 파일로 씁니다. 없으면 오류 로그 구성 데이터베이스의 값을 씁니다.
-j ErrorID[,ErrorID] 지정한 오류 ID의 항목을 지웁니다.
-J ErrorLabel 지정한 오류 레이블의 항목을 지웁니다.
-k ErrorID[,ErrorID] 지정한 오류 ID를 뺀 모든 항목을 지웁니다.
-K ErrorLabel 지정한 오류 레이블을 뺀 모든 항목을 지웁니다.
-l SequenceNumber 지정한 순서 번호의 항목을 지웁니다.
-m Machine 지정한 머신의 항목을 지웁니다. 값은 uname -m이 돌려줍니다.
-n Node 지정한 노드의 항목을 지웁니다. 값은 uname -n이 돌려줍니다.
-N List 지정한 자원 이름의 항목을 지웁니다. 소프트웨어 오류면 오류를 감지한 자원, 하드웨어 오류면 장치나 시스템 구성 요소 이름입니다. 그 구성 요소가 고장 났다는 뜻이 아니라 분석할 진단 모듈을 정하는 데 씁니다.
-R List 지정한 자원 유형의 항목을 지웁니다. 하드웨어 오류면 장치 유형, 소프트웨어 오류면 LPP입니다.
-S List 지정한 자원 분류의 항목을 지웁니다. 하드웨어 오류면 장치 분류입니다.
-T List 지정한 오류 유형의 항목을 지웁니다. PERM, TEMP, PERF, PEND, INFO, UNKN.
-y FileName FileName을 오류 레코드 템플릿 파일로 씁니다.

목록 값은 쉼표로 나누거나, 큰따옴표로 감싸고 쉼표나 공백으로 나눕니다.

영어 원문
  • -d List — Deletes error-log entries in the error classes specified by the List variable. The List variable values can be separated by , (commas), or enclosed in " " (double quotation marks) and separated by , (commas) or space characters. The valid List variable values are H (hardware), S (software), O (errlogger messages), and U (undetermined).
  • -i File — Uses the error-log file specified by the File variable. If this flag is not specified, the errclear command uses the value from the error-log configuration database.
  • -j ErrorID[,ErrorID] — Deletes the error-log entries specified by the ErrorID (error identifier) variable. The ErrorID variable values can be separated by , (commas), or enclosed in " " (double quotation marks) and separated by , (commas) or space characters.
  • -J ErrorLabel — Deletes the error-log entries specified by the ErrorLabel variable. The ErrorLabel variable values can be separated by , (commas), or enclosed in " " (double quotation marks) and separated by , (commas) or space characters.
  • -k ErrorID[,ErrorID] — Deletes all error-log entries except those specified by the ErrorID (error identifier) variable. The ErrorID variable values can be separated by , (commas), or enclosed in " " (double quotation marks) and separated by , (commas) or space characters.
  • -K ErrorLabel — Deletes all error-log entries except those specified by the ErrorLabel variable. The ErrorLabel variable values can be separated by , (commas), or enclosed in " " (double quotation marks) and separated by , (commas) or space characters.
  • -l SequenceNumber — Deletes error-log entries with the specified sequence numbers. The SequenceNumber variable values can be separated by , (commas), or enclosed in " " (double quotation marks) and separated by , (commas) or space characters.
  • -m Machine — Deletes error-log entries for the machine specified by the Machine variable. The uname -m command returns the value of the Machine variable.
  • -n Node — Deletes error-log entries for the node specified by the Node variable. The uname -n command returns the value of the Node variable.
  • -N List — Deletes error-log entries for the resource names specified by the List variable. The List variable is list of names of resources that have detected errors. For software errors, these are the names of resources that have detected errors. For hardware errors, these are names of devices or system components. It does not indicate that the component is faulty or needs replacement. Instead, it is used to determine the appropriate diagnostic modules to be used to analyze the error. The List variable values can be separated by , (commas), or enclosed in " " (double quotation marks) and separated by , (commas) or space characters.
  • -R List — Deletes error-log entries for the resource types specified by the List variable. For hardware errors, the List variable is a device type. For software errors, the value of the List variable is LPP. The List variable values can be separated by , (commas), or enclosed in " " (double quotation marks) and separated by , (commas) or space characters.
  • -S List — Deletes error-log entries for the resource classes specified by the List variable. For hardware errors, the List variable is a device class. The List variable values can be separated by , (commas), or enclosed in " " (double quotation marks) and separated by , (commas) or space characters.
  • -T List — Deletes error-log entries for error types specified by the List variable. Valid List variable values are: PERM, TEMP, PERF, PEND, INFO, and UNKN. The List variable values can be separated by , (commas), or enclosed in " " (double quotation marks) and separated by , (commas) or space characters.
  • -y FileName — Uses the error-record template file specified by the FileName variable.

보안

접근 제어: root만 실행할 수 있습니다.

RBAC 사용자와 Trusted AIX 사용자는 주의하세요. 이 명령은 특권 작업을 할 수 있으며, 특권 작업은 특권 사용자만 할 수 있습니다. 특권과 권한 목록은 lssecattr 명령이나 getcmdattr 하위 명령으로 봅니다(6.1).

영어 원문

Access Control: Only the root user can run this command.

Attention RBAC users and Trusted AIX users: This command can perform privileged operations. Only privileged users can run privileged operations. For more information about authorizations and privileges, see Privileged Command Database in Security. For a list of privileges and the authorizations associated with this command, see the lssecattr command or the getcmdattr subcommand.

예제

명령 하는 일
errclear 0 오류 로그의 모든 항목을 지움
errclear -d S 0 소프트웨어 오류로 분류된 모든 항목을 지움
errclear -i /var/adm/ras/errlog.alternate 0 다른 오류 로그 파일의 모든 항목을 지움
errclear -i /var/adm/ras/errlog.alternate -d H 0 다른 오류 로그 파일의 하드웨어 항목을 지움

자주 쓰는 형태:

bash
errpt -a > /tmp/errpt.$(date +%Y%m%d).txt   # 지우기 전에 남겨 두기
errclear 30                                  # 30일보다 오래된 항목만 지움
errclear -J ERRLOG_ON,ERRLOG_OFF 0           # 이 레이블 항목만 지움
영어 원문
  1. To delete all entries from the error log, enter:
errclear 0
  1. To delete all entries in the error log classified as software errors, enter:
errclear -d S 0
  1. To clear all entries from the alternate error-log file /var/adm/ras/errlog.alternate, enter:
errclear -i /var/adm/ras/errlog.alternate 0
  1. To clear all hardware entries from the alternate error-log file /var/adm/ras/errlog.alternate, enter:
errclear -i /var/adm/ras/errlog.alternate -d H 0

파일

파일 설명
/etc/objrepos/SWservAt 소프트웨어 서비스 보조 속성 객체 클래스, 곧 오류 로그 구성 데이터베이스
영어 원문
  • /etc/objrepos/SWservAt — Contains the Software Service Aids Attributes object class, which is the error-log configuration database.

Related reference:

  • errlogger Command

Related information:

  • uname subroutine
  • errlog command
  • Error Logging Overview

리눅스(GNU)와 다른 점

리눅스에서는 systemd 저널을 journalctl --vacuum-time=30d(기간), --vacuum-size=500M(크기)로 줄이고, 커널 링 버퍼는 dmesg -C로 비웁니다. 텍스트 로그는 logrotate로 돌려 지웁니다. 오류 ID나 분류로 골라 지우는 기능은 없습니다.