Will a backgroup job stop after vpn connection fails?
Hi:
I want to know whether I need to do something special to run a long running script from vpn terminal. Sometime, the vpn session may fail without a good reason. Will the backgroup job stop when the vpn terminal disconnect? If yes, what can I do to run a script which will run event the vpn session disconnect? |
Use this cmd format:
nohup yourcmd >yourlog 2>&1 & & => background nohup => detaches from terminal, so if cxn breaks, prog will continue. |
Another way of achieving it is running the script on screen, if it is installed (usually is):
Code:
screen /path/to/yourscript.sh Code:
screen -d -r It depends on you then, which one is more comfortable for you. |
Yet another way is "disown" command. You use it after the job is launched, which is a benefit. If you have only jobs you want to keep after disconnect, you just say "disown" until it complains about lack of background jobs. The drawback is that you cannot reconnect disowned jobs to your next session.
|
Quote:
|
BTW, disown is an internal bash command -- therefore, which & man won't work on it, but "help disown" will give basic info. about it.
For slightly more info, search the bash man page for "disown [". |
All times are GMT -5. The time now is 09:37 PM. |