Results 1 to 8 of 8

Thread: Start process after an other has finished

  1. #1

    Default Start process after an other has finished

    Hi guys,

    I have a short question.
    I would like to start a process after an other one finished. Are there some commands to do so?

    The first process is a python script i've started with nohup. This script will take a while to finish. Thats why i would like to write a script, that starts an other script right after the first one has finished.

    Is this possible? If possible I would prefer a script written in python or bash

    thank you!

  2. #2
    Join Date
    Jun 2008
    Location
    UTC+10
    Posts
    9,686
    Blog Entries
    4

    Default Re: Start process after an other has finished

    Code:
    nohup python somescript.py
    python nextscript.py

  3. #3

    Default Re: Start process after an other has finished

    Ah ok thats means i will write a script, which starts both yhe processe. Great idea thx

    but what can I do if the first process is alreadz running?

  4. #4
    Join Date
    Jun 2008
    Location
    UTC+10
    Posts
    9,686
    Blog Entries
    4

    Default Re: Start process after an other has finished

    Then you should go back to the beginning.

  5. #5

    Default Re: Start process after an other has finished

    If started in console then suspend it with ctrl z, check with jobs.

    Then
    Code:
    fg %1; echo "do this after"
    Where %1 is the job number.
    Man first, have a try at Info, have a look at Wiki, if all that fails Scroogle!!!!!
    If I've helped click on the Rep button I don't know what it does but it sounds cool.

  6. #6
    Join Date
    Jun 2008
    Location
    Earth - Denmark
    Posts
    10,730

    Default Re: Start process after an other has finished

    please next time, post such questions to the correct forum:
    http://forums.opensuse.org/developme...ing-scripting/

    --
    DenverD (Linux Counter 282315)
    CAVEAT: http://is.gd/bpoMD
    posted via NNTP w/TBird 2.0.0.23 | KDE 3.5.7 | openSUSE 10.3
    2.6.22.19-0.4-default SMP i686
    AMD Athlon 1 GB RAM | GeForce FX 5500 | ASRock K8Upgrade-760GX |
    CMedia 9761 AC'97 Audio

  7. #7

    Default Re: Start process after an other has finished

    ok sorry next time i will think of it next time.

    thank you all!!

  8. #8
    Join Date
    Jul 2008
    Location
    Seattle, WA
    Posts
    17,044

    Default Re: Start process after an other has finished

    On Mon, 07 Jun 2010 11:26:01 +0000, gecko9922 wrote:

    > I would like to start a process after an other one finished. Are there
    > some commands to do so?


    The fairly common way to do this is to create some sort of semaphore
    (say, create a temp file in /var/run while the first process is running;
    at the end of the first script, remove the semaphore file) and then in
    the second process, include a check to see if the semaphore file exists,
    and if it does, either exit or loop back, delay, and check again.

    Jim



    --
    Jim Henderson
    openSUSE Forums Administrator

Posting Permissions

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