Running python script in background with nohup and timing it
I'm开发者_Go百科 running a python script on a remote server with the time command as follows:
time python myscript.py
SSH timeout occurs on the server after some time, so i also need to run it with nohup.So, i have the following two questions:
- Is
nohup time myscript.py &
the right command to execute my python script ? - If the script runs in the background, how will i see the output of the time command ?
Please Help Thank You
nohup will usually write STDOUT and STDERR to a file called "nohup.out" in the current directory. You'll be able to see the output of time at the end of that file.
Another way of solving this redirection of the output like this:
nohup time bla.py >myoutput &
To 1.: Yes
To 2.: You can redirect the output to a file
nohup time myscript.py > ~/time_output &
精彩评论