linux - How can I 'nohup' a command and log the output of 'time' -
I want to give a long-running script time, and the output of time
A log file, such as:
(time php mylongcommand.php) & amp; & Gt; Dump
This works, but if I want the command nohup
then I can see the log later, the following code does not work:
nohup (time php mylongcommand.php) & amp; Dump & amp;
Any suggestions?
(time php mylongcommand .php) & amp; & Gt; Dump & lt; / Dev / null & amp;
should also do the trick by redirecting the input from / dev / null
and keeping the process in the background, the same effect is achieved as You nohup
. You should be able to exit your shell session without any closed work error, and the process will continue.
Comments
Post a Comment