1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Tips: AIXにおいて24時間前からのerrlogを出力する(ksh93 printfの拡張機能を利用)

Posted at

備忘

AIXにおいて24時間前からのerrlogを出力する

これを行うには以下が可能

errpt -s "$(/usr/bin/ksh93 -c 'printf "%(%m%d%H%M%y)T" "24 hours ago"')"
  • errlogコマンドの-sオプションにより開始時点を指定可能。mmddhhmmyyフォーマット(month, day, hour, minute, and year)で日時を指定。
  • mmddhhmmyy書式の24時間前は、ksh93のprintfの拡張機能が利用可能。
    • "%(%m%d%H%M%y)T"にて書式
    • "24 hours ago"にて日時を指定
      • "yesterday", "next Monday" などが利用可能。

なお、TZ環境変数の JST-9 における数字部分を操作して24時間前を表す様な対応は、AIX 7以降で Asia/Tokyo のような IANA タイムゾーン表記となり、非推奨。
Perlを利用することでも可能だが、bos.rte.shellに含まれるksh93を利用する方が確実でしょう。

情報

1
0
5

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?