Docker 컨테이너 uptime 확인

1 개요[ | ]

docker 컨테이너 uptime 확인

2 stat ★[ | ]

echo $(($(date +%s)-$(stat -c%Z /proc))) seconds
echo $(($(date +%s)-$(stat -c%Z /proc))) | awk '{print $1/60" minutes"}'
echo $(($(date +%s)-$(stat -c%Z /proc))) | awk '{print $1/3600" hours"}'
echo $(($(date +%s)-$(stat -c%Z /proc))) | awk '{print $1/86400" days"}'
# echo $(($(date +%s)-$(stat -c%Z /proc))) seconds
1591004 seconds
# echo $(($(date +%s)-$(stat -c%Z /proc))) | awk '{print $1/60" minutes"}'
26516.7 minutes
# echo $(($(date +%s)-$(stat -c%Z /proc))) | awk '{print $1/3600" hours"}'
441.946 hours
# echo $(($(date +%s)-$(stat -c%Z /proc))) | awk '{print $1/86400" days"}'
18.4144 days

3 ps[ | ]

  • ps 명령어가 없는 경우가 있음
# ps -oetime= | head -1
58:59
# ps -oetime= | head -1
 1h13

4 같이 보기[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}