Created
February 8, 2023 14:35
-
-
Save aoirint/137cff3217d5823b50f9ac056d6301e2 to your computer and use it in GitHub Desktop.
既存のentrypointを置き換えてubuntu/bind9のログを永続化するシェルスクリプト
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
{ | |
/usr/local/bin/docker-entrypoint.sh $@ | |
} \ | |
1> >(tee -a >(sed -u "s/^/[$(date -Ins)] /" >> /bind_logs/named_stdout.log) >&1) \ | |
2> >(tee -a >(sed -u "s/^/[$(date -Ins)] /" >> /bind_logs/named_stderr.log) >&2) |
Q. 秒以下と秒の区切りが,
になっているのを.
にできませんか?
GNU dateが区切りを,
にすることが原因ですが、変更するオプションはありません。個人的には,
にはなじみがないけれど、ISO 8601的には,
の方が推奨らしい(ISO文書のAbstractにある例も.
になってるけど、ほんとか??)。
- https://www.iso.org/iso-8601-date-and-time-format.html
- https://ja.wikipedia.org/w/index.php?title=ISO_8601&oldid=93550032#%E6%99%82%E5%88%BB
- https://en.wikipedia.org/w/index.php?title=ISO_8601&oldid=1137083292#Times
ISO原典読むの5万くらいする(166 + 187 CHF = 353 CHF ~ 50000 JPY)らしいのでWikipediaで許して...(RFC 3339を読めばいいのかもしれないけど)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
named_stderr.log
named_stdout.log