Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Redirecting output afterwards



Often I've logged in from another location and then began executing a
large job, say "tar czvf foo /". Later, it turns out that the job will
take hours to complete, and I'll have to log out before that. Of course, I
will then ^Z, bg and disown the job, but I will lose the output. Sometimes
it is essential to know if the job returned errors or warnings. The output
itself is sometimes crucial (du, for example, can take hours in ~70GB data
dir).

Now, if I had been clever enough to realize this when I launched the job,
this would be no problem:

prompt % nohup job
prompt % job >& file &
  or even
prompt % screen job

but now the job has already been running for hours, and I wouldn't wan't
to start it all over again just to be able to log out and later see the
result.

What I was thinking is that could something like

prompt % job &
[1] 6643

(after some hours)
prompt % %1 >& output.file       # redirect output of a running job
prompt % disown %1
prompt % exit

be possible in theory?


-- 
"Sillä minä en ole mukava mies, enkä siksi syyttä huou tätä mykistävää
kyynisyyttä ja kaltaiseni luonne vaatii vuosikausien harjoituksen, en ole
mukava mies!  Hyväntahtoisuuteni loppuu tähän! Painukaa helvettiin!  Niin! 
En ole mukava mies!  E-en! En ole mukava, En ole mukava mies!" - YUP



Messages sorted by: Reverse Date, Date, Thread, Author