- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- nohup.out does not get created
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-28-2001 08:08 AM
тАО06-28-2001 08:08 AM
I have written a bourne shell script which starts a process. Extract is:
-
cd $BIN
nohup $BIN/startmyprog
cat nohup.out
-
--
The problem is when I schedule this to run through either crontab or at, I get an error message: nohup.out not found. The nohup.out is necessary since all the application log gets sent to this file.
However, when I execute this via command line manually, a nohup.out gets created in $BIN subdirectory.
Could anyone suggest a method where I can automatically schedule this script such that it creates the nohup.out?
Thanks a lot!!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-28-2001 08:15 AM
тАО06-28-2001 08:15 AM
Re: nohup.out does not get created
Clay
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-28-2001 01:32 PM
тАО06-28-2001 01:32 PM
Solutionnohup $BIN/startmyprog >/tmp/nohup.out 2>&1
This will send both standard out and standard error to the /tmp/nohup.out file.
Each time the command is run the /tmp/nohup.out file will be truncated. If you want the results from every run to be appended to the end of the /tmp/nohup.out file then you can use '>>' instead of just '>'.
Also, the file can be any name that you like.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-28-2001 08:39 PM
тАО06-28-2001 08:39 PM
Re: nohup.out does not get created
Have you checked to see what the return code is after that line has completed? That might give you a clue as to whether nohup working correctly.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-29-2001 05:07 AM
тАО06-29-2001 05:07 AM
Re: nohup.out does not get created
#!/bin/ksh
at the begining of script so it can run with cron. Could also run .profile to get your variables set.
regards.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-29-2001 05:08 AM
тАО06-29-2001 05:08 AM
Re: nohup.out does not get created
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-29-2001 09:06 AM
тАО06-29-2001 09:06 AM
Re: nohup.out does not get created
Your commands will be executed correctly if your BIN variable is well setting.
But when you schedule it in crontab, you MUST include your environment variable in the crontab by executing your profile as your first command and continue with the rest like:
. /
cd $BIN
nohup $BIN/startmyprog
cat nohup.out
-
This will solve your problem.