AIX

AIX

Connect with fellow AIX users and experts to gain knowledge, share insights, and solve problems.

 View Only
  • 1.  How to configure a shell script to continuous run in the background

    Posted Tue April 08, 2008 02:35 PM

    Originally posted by: SystemAdmin


    I have two shell scripts that I run on an AIX server - but I have to leave the putty sessions active or the jobs will stop running.

    How do I go about configuring the scripts so that they continue to run after logging out the PUTTY sessions?

    Thanks,

    Gareth....


  • 2.  Re: How to configure a shell script to continuous run in the background

    Posted Tue April 08, 2008 02:51 PM

    Originally posted by: alethad


    Have you tried the nohup command and sending it to background?
    nohup scriptname &

    Good luck.


  • 3.  Re: How to configure a shell script to continuous run in the background

    Posted Tue April 08, 2008 02:56 PM

    Originally posted by: SystemAdmin


    The below is the exact contents of the script: startFXG-OUT-NonGui.sh
    1. Set the Input parameters
    . ./SetVariables.sh

    1. set flexml related classpath
    . ./setClasspath.sh

    1. clear the screen
    clear
    1. Go to the folder
    cd $XMLGATEWAY_INSTALL_DIR\classes
    1. start the IN service
    java $JAVA_OPTIONS com.iflex.fcc.xmlgateway.nongui.IFWrappr START_OUT

    read


  • 4.  Re: How to configure a shell script to continuous run in the background

    Posted Tue April 08, 2008 03:59 PM

    Originally posted by: esv


    have u heard of "screen" utility???

    if you don't want to use screen, which I wouldn't understand anyway, I would throw all commands you listed above into a file, give it read-exec access bits and execute with the following syntax.
    nohup <fullpath_to_script>/scriptname > /tmp/output.msgs 2>&1 &

    you might need to specify full path to all your scripts in order for that to work.

    best regards,
    esv.