Find the answer to your Linux question:
Results 1 to 7 of 7
I need to a run a perl script in the background of a linux box. Even with the & command when I kill ssh and logoff it dies. How can ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined! dwhs's Avatar
    Join Date
    Sep 2005
    Posts
    19

    Can someone please post the code for running a perl script after you logoff


    I need to a run a perl script in the background of a linux box.

    Even with the & command when I kill ssh and logoff it dies.

    How can I keep this thing running.

    Thanks.

    Please post a sample code.

  2. #2
    Just Joined! dwhs's Avatar
    Join Date
    Sep 2005
    Posts
    19
    Or just running the program later after I've logged off would be fine.

    If you know the code for this.

  3. #3
    Linux Engineer Javasnob's Avatar
    Join Date
    Jul 2005
    Location
    Wisconsin
    Posts
    942
    Here's what I typically do:
    Code:
    % at now
    > ./script.pl
    (Ctrl-D)
    The at program schedules a script to be run at a specific time; in this case, right away.
    Flies of a particular kind, i.e. time-flies, are fond of an arrow.

    Registered Linux User #408794

  4. $spacer_open
    $spacer_close
  5. #4
    Just Joined! dwhs's Avatar
    Join Date
    Sep 2005
    Posts
    19
    Quote Originally Posted by Javasnob
    Here's what I typically do:
    Code:
    % at now
    > ./script.pl
    (Ctrl-D)
    The at program schedules a script to be run at a specific time; in this case, right away.
    When I type this I get a error.

    root@foofoo [~]# % at now
    -bash: fg: %: no such job

    it never makes it to the > line.

    thanks

  6. #5
    Linux Engineer Javasnob's Avatar
    Join Date
    Jul 2005
    Location
    Wisconsin
    Posts
    942
    You don't type the '%'; that represents the prompt. For example, my prompt looks like this:
    Code:
    rob@TheRing ~ $
    I suppose it was my mistake though; it should have been a '$'.
    Flies of a particular kind, i.e. time-flies, are fond of an arrow.

    Registered Linux User #408794

  7. #6
    Just Joined! dwhs's Avatar
    Join Date
    Sep 2005
    Posts
    19
    Quote Originally Posted by Javasnob
    You don't type the '%'; that represents the prompt. For example, my prompt looks like this:
    Code:
    rob@TheRing ~ $
    I suppose it was my mistake though; it should have been a '$'.
    So like this:

    Code:
    $ at now
    > ./script.pl
    (Ctrl-D)

  8. #7
    Linux Engineer Javasnob's Avatar
    Join Date
    Jul 2005
    Location
    Wisconsin
    Posts
    942
    Yes, that's how you do it.
    Flies of a particular kind, i.e. time-flies, are fond of an arrow.

    Registered Linux User #408794

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •