Sunday, December 5, 2010

How to run script or any command and logout and script still runnig

Our problem today is:

you have a remote server linux and you need to run command to restore database or run script which will take about 1 hour or more. you need to close your session and command still running because if you logout your command will stop but we have a solution today

to run the script and still running  after logout by

nohup your_commadn &

don't forget  &   because it put your command in background

source : http://www.cyberciti.biz/tips/nohup-execute-commands-after-you-exit-from-a-shell-prompt.html

enjoy your time
  ;)

3 comments:

  1. but why don't you use a screen??
    http://www.rackaid.com/resources/linux-screen-tutorial-and-how-to/

    ReplyDelete
  2. screen is a great

    but here we just need the operating system don't catch hang up signal

    so when logout every this stop
    except services and commands after nohupp



    thanks a lot gemmy for your experience sharing

    ReplyDelete