Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

nohup.out where is it

Status
Not open for further replies.

Chrissirhc

Programmer
May 20, 2000
926
GB
Hi,

If in my crontab I have:

1 * * * * /home/me/nohup.sh

And in nohup.sh there is "nohup test.sh &"

In test.sh there is "ls -l"

Why when the crontab runs does nohup.out not get created?

Thanks,

Chris
 
Do a find / -name "nohup*" and it should appear somewhere. My guess is that it is in / directory, assuming a root crontab
HTH

Dickie Bird (:)-)))
 
The crontab is my personal one and isn't root. I do not have root previlidges. Is it possible nohup.out has gone somewhere where I can't see it?
 
Shouldn't the output be mailed to your account?


I love deadlines. I like the whooshing sound they make as they fly by.

Douglas Adams
 
maybe nohup.out isn't created because using nohup isn't really necessary for a script kicked off by cron? I've created your setup as the root user and nohup.out isn't created anywhere on the system.

If you are looking for error messages that might be thrown out by your script, I think you should redirect stderr to a file.

 
From man crontab...

Be sure to redirect the standard output and standard error from commands. If this is not done, any generated standard output or standard error is mailed to the user.

From man nohup....

If output from nohup is not redirected, the output is sent to nohup.out.

When nohup is run, cron is already redirecting the output to mail to you.

PS. is this just an experiment? I can't see any reason to use either nohup or & in a cron job.

 
In your test.sh, why don't you direct the output of the ls command to a file that you can access:

ls -l > /directory/file



Blue [dragon]

If I wasn't Blue, I would just be a Dragon...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top