- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- ssh and nohup
Operating System - HP-UX
1822544
Members
2682
Online
109642
Solutions
Forums
Categories
Company
Local Language
юдл
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Forums
Discussions
юдл
back
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
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- 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-03-2009 04:47 PM
тАО06-03-2009 04:47 PM
Hello,
i was wondering if you could assist me in the following issue. i am trying to run a command remotely via ssh however i want insure the command is running in the background even after the ssh session timesout. basically something like this
ssh user@host "nohup sh ~/command.sh parameter &"
unfortunately this does not work. if kill the session it kills the command. i am i missing anything in the command. please note i would like the ssh session to continue running in the forground until it timesout. is this possible in this case.
thank you
i was wondering if you could assist me in the following issue. i am trying to run a command remotely via ssh however i want insure the command is running in the background even after the ssh session timesout. basically something like this
ssh user@host "nohup sh ~/command.sh parameter &"
unfortunately this does not work. if kill the session it kills the command. i am i missing anything in the command. please note i would like the ssh session to continue running in the forground until it timesout. is this possible in this case.
thank you
Solved! Go to Solution.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-03-2009 08:31 PM
тАО06-03-2009 08:31 PM
Re: ssh and nohup
Why do you have that "sh" there? A proper script can be executed directly by nohup:
nohup ~/command.sh parameter &
nohup ~/command.sh parameter &
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-03-2009 09:59 PM
тАО06-03-2009 09:59 PM
Solution
For initiating a command remotely to let it run in the background, do:
ssh user@host "nohup /path/command.sh parameter 1>/path/file.out 2> /path/file.out &"
The ssh session will end as soon as the command is triggered, but the command will run in background until it completes.
file.out will keep the stdout and stderr outputs generated out of the command/script.
==> "i would like the ssh session to continue running in the forground until it timesout. is this possible in this case."<== This is not possible.
ssh user@host "nohup /path/command.sh parameter 1>/path/file.out 2> /path/file.out &"
The ssh session will end as soon as the command is triggered, but the command will run in background until it completes.
file.out will keep the stdout and stderr outputs generated out of the command/script.
==> "i would like the ssh session to continue running in the forground until it timesout. is this possible in this case."<== This is not possible.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-03-2009 10:55 PM
тАО06-03-2009 10:55 PM
Re: ssh and nohup
That did it. perfect.
Thank you
Thank you
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Learn About
News and Events
Support
© Copyright 2025 Hewlett Packard Enterprise Development LP