LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 01-30-2006, 10:52 PM   #1
chibi
Member
 
Registered: Aug 2004
Location: Canada
Distribution: Archlabs
Posts: 65

Rep: Reputation: 15
Specify where nohup outputs to?


Hi hi,

I have a problem with nohup that has really given me a headache. If you guys can help me with this, it'd really make my life a whole lot easier.

I assume you are familiar with nohup if you are replying to this thread. If I cd into /home/chibi and type nohup ./myfile & it will create a file called nohup.out located at /home/chibi/nohup.out and log all of myfile's output to it. This is true in a regular environment and circumstances.

Unfortunately, the environment that I am working in allows me to execute commands, but not through a terminal. Where the command is sent, has no write permissions whatsoever. So any nohup command I do just doesn't work because it wants to write nohup.out in the same directory the command was executed from. But as far as I know there isn't a directory! But again even if there is, there is no write permissions there at all.

So what I really need is, even though I am executing the command in /home/chibi/ , I need it to tell nohup to put its output file somewhere else like /pub/logs/nohup.out for instance.

Is this possible and how would I go about doing this?

Your help is greatly appreciated. I have a horrid work around for this right now, but it creates zombie processes that eventually cause services to stop working, requiring them to be restarted.

Thank you!

-Chi

Last edited by chibi; 01-30-2006 at 10:58 PM.
 
Old 01-31-2006, 02:15 AM   #2
Dazed_75
Member
 
Registered: Oct 2005
Location: Arizona
Distribution: Debian, Ubuntu, Puppy, others
Posts: 36

Rep: Reputation: 16
Looking at the docs (man nohup and info coreutils nohup) makes me believe you can get the output unless the environment or command you are using create a permission or identity problem. However, you will not be able to specify a location given the allowable arguments.

I say this not from experience but from the docs that say if nohup.out can't be written to in the default destination, it will be sent to $HOME/nohup.out. One thing to note though is the detail that it creates no group or other permissions. Seems you can get around that by creating the file beforehand with the permissions you desire as the docs say it does not change them.

Again, this is only from my reading the docs so I may be way out in left field.

Good luck.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
nohup retuncode krusty_lab Linux - General 2 10-13-2005 06:04 AM
help on nohup vinayuh Linux - General 3 07-22-2005 12:24 PM
nohup command chbin Slackware 1 03-31-2005 03:47 AM
Different nmap outputs, one ip iceman47 Linux - Security 10 05-12-2003 04:13 PM
nohup failure tn1681 Programming 1 01-09-2003 05:40 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 11:28 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration