in reply to Re: how to sleep-awake on perl script?
in thread how to sleep-awake on perl script?

I cant run the program in bg or nohup.I run this script inetractively-constantly inputing some or the other value-Can't automate it.All I want is to stop the process for few hours and then continue from the point where I stopped. -It's kind of building the output brick-by-brick- some bioinformatics stuff.
  • Comment on Re^2: how to sleep-awake on perl script?

Replies are listed 'Best First'.
Re^3: how to sleep-awake on perl script?
by almut (Canon) on Apr 24, 2009 at 01:19 UTC
    All I want is to stop the process for few hours and then continue from the point where I stopped.

    That's exactly what suspend/resume is for.  To suspend the program, you'd type ^Z (= Ctrl-z)1 while the program is running. Then type bg to send the (stopped) process in the background. To resume it again, type fg (or fg <jobnumber> in case you have several backgrounded — type jobs to list them).

    Have you tried that?  What happens, or doesn't work?

    ___

    1  ^Z is the typical tty setting. Type stty -a to see what yours is set to — mine shows "susp = ^Z", for example (among other stuff)

Re^3: how to sleep-awake on perl script?
by repellent (Priest) on Apr 24, 2009 at 02:15 UTC
      I cant run the program in bg or nohup.

    What do you mean you cannot run nohup? Run your interactive script this way:
    $ nohup myscript.pl arg1 arg2

    When you need a break, hit Ctrl-Z and that will suspend your interactive program. Record the PID number and logoff. When you logon again in the future, do:
    $ fg PID

    Google helps.
      ...or even (to save recording &/or remembering the PID on ksh/bash shells), when logging back on...
      > # list the currently running jobs (including your suspended job) > jobs > # select the appropriate job number > fg %<job num>

      A user level that continues to overstate my experience :-))