- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: script always run in background
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
Forums
Discussions
Discussions
Discussions
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
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
05-06-2004 08:12 PM
05-06-2004 08:12 PM
script always run in background
Is there any way that I can put a shell script that act like a daemon. I mean to make it always run in background.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2004 08:26 PM
05-06-2004 08:26 PM
Re: script always run in background
svrmgrl
connect internal;
recover managed standby database;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2004 08:43 PM
05-06-2004 08:43 PM
Re: script always run in background
To put a script in the background detached from tty : nohup.
As for the deamon aspect - like automatic start at boot : /etc/rc scripts
You might want to do another script (in crontab for instance) to check that the first one is always running.
Anyway, can you explain how / why you entend to use such script ?
Cheers
Nicolas
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2004 08:49 PM
05-06-2004 08:49 PM
Re: script always run in background
man inittab
Regards,
Jean-Luc
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2004 09:18 PM
05-06-2004 09:18 PM
Re: script always run in background
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2004 09:55 PM
05-06-2004 09:55 PM
Re: script always run in background
You can get some ideas from /etc/init.d/functions and search for the daemon function.
Frank.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2004 10:31 PM
05-06-2004 10:31 PM
Re: script always run in background
To make it automatically run itself in the background, you will have to append "&" to the command. You might also have to redirect output of the command somewhere; preferably not /dev/null though, since I think you might one day dearly wish to see what went wrong with "recover managed standby database".
So, something like this:
#!/bin/sh
( svrmgrl
recover managed standby database;
EOC ) >/tmp/recover.out 2>&1 &
Now /tmp/recover.out will always have the output of the *latest* run of the script, and only that.