![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to rename Xterm terminal in VNC session | bache_gowda | UNIX for Dummies Questions & Answers | 0 | 04-16-2007 06:44 AM |
| sqlplus session being able to see unix variables session within a script | 435 Gavea | Shell Programming and Scripting | 2 | 07-03-2006 10:11 AM |
| mac 10.4>terminal>linux remote server>ssh login accepted>session closed-why? | xprankard | UNIX for Dummies Questions & Answers | 0 | 01-21-2006 10:09 AM |
| terminal 8/ new Xwindows session | moxxx68 | UNIX for Advanced & Expert Users | 1 | 05-26-2005 10:43 AM |
| Running Terminal and/or X-Windows in Mac OS X | liquidcross | UNIX for Dummies Questions & Answers | 2 | 07-24-2002 10:59 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Running a script without a terminal session
I'm trying to figure out how I can run a script "myScript.sh" in such a way that if my remote network connection gets disconnected, the script doesn't stop functioning.
Right now I log in, run "./myScript.sh" and watch my output get pumped to a log file for about 10 hours. Only problem is that if I (or my ISP) closes my network connection ever, I have to start the whole thing all over again. I have heard something about creating a .pid file and somehow running the script in a different session, but how do I go about doing that? |
|
||||
|
All you really need to know
1. nohup command = Don't send a Hang Up Signal to the process if shell exits
2. If you don't redirect output it attempts to create a nohup.out log file in your present working directory which maybe fine, but I find UGLY. 3. You have to background (&) the process. 4. Best Practice, example of execution cd /path/to/bin/directory nohup `pwd`/script.sh 1>/path/to/logdir/logfile.out 2>&1 & |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|