如何获取运行但在后台的特定脚本的执行时间?

How to get execution time of a specific script that is running, but in the background?

我有一个在后台运行的脚本 (php) (nohup php script...),但由于某种原因它最终停止了,因为这个脚本只在它运行时生成 'logs'有事做。

我需要 'something' 知道 运行 到它停止的那一刻有多长,但我不想让这个脚本的责任每秒 'make log' ,我想要一些方法来查看它 运行 的时间,但是这样我就可以 "close the all terminal" 屏幕并且在重新连接到终端时,我可以查询停止时间,甚至是执行时间和脚本停止的时间。

您可以通过执行以下命令来添加执行时间nohup日志:

nohup /usr/bin/time php script...