我有一个应用程序/吊舱:app1
有 2 个容器service1
和service2
. 这些服务将日志写入 /var/log/app1Service1.log 和 /var/log/aapp1Service2.log。我想从 mac 的 cli 跟踪日志。尝试如下,但没有奏效。
~ $ kubectl exec app1-6f6749ccdd-4ktwf -c app1Service1 "tail -f -n +1 /var/log/app1Service1.log"
rpc error: code = 2 desc = oci runtime error: exec failed: container_linux.go:247: starting container process caused "exec: \"tail -f -n +1 /var/log/app1Service1.log\": stat tail -f -n +1 /var/log/app1Service1.log: no such file or directory"
command terminated with exit code 126
~ $
Run Code Online (Sandbox Code Playgroud)
以下命令有效:
kubectl exec app1-6f6749ccdd-4ktwf -c app1Service1 ls
kubectl exec …
Run Code Online (Sandbox Code Playgroud) 在 UTC 或不同时区配置服务器时,如何在 linux 终端中获取本地日期和时间?
这是我现在得到的,但我想在当地时区看到。例如:PST/PDT。
[jenkins@myServer ~]$ date
Thu Jul 28 18:16:48 UTC 2016
Run Code Online (Sandbox Code Playgroud)
我不打算使用 hwclock 或更新 /etc/localtime 来更改系统时间。只是想为用户更改它。
另外,请让我知道 - 如何保留它以备将来登录。