Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8643065
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T11:56:23+00:00 2026-06-12T11:56:23+00:00

i am running python scripts on a ubuntu server though cronjob bellow is my

  • 0

i am running python scripts on a ubuntu server though cronjob bellow is my bash file content

#!/bin/bash
cd /home/ubuntu/
PATH=$PATH:/usr/local/bin
export PATH
nohup scrapy crawl first_job &
nohup scrapy crawl second_job &
nohup scrapy crawl third_job &
wait $(pgrep third_job)
nohup scrapy crawl fourth_job &

what i want is fourth_job start executing as soon as third_job complete

but

currently even if third_job complete , fouth_job wait for the completion of first_job and second_job

thanks in advance

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T11:56:24+00:00Added an answer on June 12, 2026 at 11:56 am

    A Safer way to get a PID of the last background process is to remember the value of $!:

    nohup scrapy crawl third_job &
    PID=$!
    wait $PID
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hey I have a windows server running python CGI scripts and I'm having a
I am running Ubuntu with python 2.7.2. script python \ /home/blainer/Desktop/convert/converter.py \ /home/blainer/Desktop/convert/urban.shp \
I tried to modify the sintax using 2to3 tool by running command python C:\Python32\Tools\scripts\2to3.py
I have a python script running on a small server that is called in
I am running a server with cherrypy and python script. Currently, there is a
I am running a server with cherrypy and python script. Currently, there is a
#!/usr/bin/python # -*- coding: utf-8 -*- import sys import os import cgi import string
I've been running Python scripts that make several calls to some functions, say F1(x)
I'm running a number of python scripts on a linux cluster, and the output
I just got some space on a VPS server(running on ubuntu 8.04), and I'm

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.