simple unix (freebsd) question..

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mrthumbs
    salad tossing sig guy
    • Apr 2002
    • 11702

    #1

    simple unix (freebsd) question..

    Im logged in as root with SSH.. i want to start a program or script to run in the background so that when i kill my SSH session it keeps running...

    Shouldnt be a cronjob.. just something that doesnt terminate when i terminate my session....
  • mrthumbs
    salad tossing sig guy
    • Apr 2002
    • 11702

    #2
    Hmm am i correct that ./command &

    does the job?

    Comment

    • HorseShit
      Too lazy to set a custom title
      • Dec 2004
      • 17513

      #3
      You want to run it in screen

      example

      screen <program-name>

      if you don't have screen installed you will have to install it

      Comment

      • prime
        Confirmed User
        • Feb 2005
        • 400

        #4
        I use screen for that trick, get it installed and start rolling

        | offshore solutions | manual labor | staff leasing | and more!
        Dedicated -Motivated-Managed Employees
        icq.: 309570461 live chat

        Comment

        • com
          Confirmed User
          • Aug 2003
          • 4541

          #5
          Originally posted by prime
          I use screen for that trick, get it installed and start rolling
          ditto ....

          Real. Professional. Hosting.
          .:Expect Nothing Less:.
          320-078-843 :: www.realprohosting.com :: [email protected]

          Comment

          • toddler
            Confirmed User
            • Jun 2002
            • 1911

            #6
            Screen is the way to go. Easy as sin

            screen some_cmd

            to detach from the screen, hit ctrl a then ctrl d

            to reattach to a screen

            screen -r


            you can have many screens going, you can screen shells, makes, etc etc.
            http://www.flickr.com/photos/zoddler/

            Comment

            • skinnay
              Confirmed User
              • Apr 2004
              • 2274

              #7
              nohup script &
              Make Real Green with ORGANIC SEO | Blog post exchange | Non-index page trades | A-B C-D Trades [icq: 194-215-962] [mail: [email protected]]

              Comment

              • pstation
                Confirmed User
                • Jul 2003
                • 1135

                #8
                nohup <command_goes_here> & works too

                nohup basicly causes the script to ingore all hangup signals, screen works awesome too as well but it's generally overkill for non-interactive scripts.

                Comment

                Working...