[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: nohup, but not nohup.out -- how to?



On Fri, Sep 02, 2005 at 12:42:52PM -0700, Andrew Sackville-West wrote:
> 
> 
> Kai Grossjohann wrote:
> >I am very fond of doing "nohup somecommand & sleep 1; tail -f
> >nohup.out" to start a background job and then watch its output.  Then
> >I can stop watching the output and log out and the job continues.
> 
> I'm a serious noob so here's a guess:
> 
> nohup somecommand & sleep 1; ln -s preferred-file-name nohup.out; tail 
> -f preferred-file-name
> 
> seems kludgy and I have no idea what the rest of that line is doing...
> 
> but that doesn't actually change the file name... just links to it. 
> hmmm.. can you make a link from nohup.out to the filename you want that 
> redirects nohup? in otherwords if you create the link in advance, won't 
> that force nohup to write to the file you want?
> 
> ln -s nohup.out preferred-name
> 
> nohup somecommand & sleep 1;  tail -f preferred-name
> 
> then the link will stay around and always point to that preferred name?
> 
Whether the link is created before or after starting nohup, it will stay 
around until it is deleted.  You could also make nohup.out be a symbolic 
link: 
ln -s preferred-name nohup.out


-- 
Yow!  Now I get to think about all the BAD THINGS I did to a BOWLING
BALL when I was in JUNIOR HIGH SCHOOL!



Reply to: