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

  • SEARCH
  • Home
  • 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 3624124
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T23:28:07+00:00 2026-05-18T23:28:07+00:00

I have a ‘long’ python script that takes roughly 45[min] to run. I use

  • 0

I have a ‘long’ python script that takes roughly 45[min] to run. I use another (a ‘scheduler’ script) python script to run this long script. When I run the ‘scheduler’ script using the terminal, everything works perfectly (meaning, the ‘long’ script runs without any issues).

I had some struggles, but eventually succeeded adding the ‘scheduler’ script to run through cron every minute. so it now ‘runs’ other script and works OK.

Here is the problem: whenever a script (that is being ‘run’ by the ‘scheduler’) has a line that says:

print "hello"

or any ‘print’ statement, the cron job runs, but terminates after 20-30 seconds. When I remove any ‘print’ statements, cron runs the jobs normally and does not terminate.

I’d like to fix this situation, and have the scripts continue to run even if they have some ‘print’ statements in them. any hints how to do it?

P.S. from within the ‘scheduler’, I use

subprocess.Popen([sys.executable, command])

to ‘run’ all other python scripts.

  • 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-05-18T23:28:08+00:00Added an answer on May 18, 2026 at 11:28 pm

    I have a hunch that it’s due to the way cron handles stdout. How are you redirecting output?

    From http://aplawrence.com/BDD/bbcronbasics.html:

    OUTPUT

    Normally the output of any program is
    sent to STDOUT (standard out) and
    usually winds up on someone’s display
    screen. For jobs started by cron,
    STDOUT will be directed to the local
    mail subsystem, which means any output
    generated by a cron job will be mailed
    to the user owning the job. If this
    is not desirable you should take steps
    to redirect your cron job’s output to
    a file. It is also suggested you
    redirect STDERR (standard error) to a
    file so as to be able to analyze any
    anomalies in your cron job’s
    execution.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Have some data in a sybase image type column that I want to use
Have some dates in my local Oracle 11g database that are in this format:
Have an app that can use tts to read text messages. It can also
Have you managed to get Aptana Studio debugging to work? I tried following this,
Have created simple Ajax enabled contact forms before that have around 12 fields -
Have any one run into trouble when running dotLess and having hacks on your
Have a LinqtoSql query that I now want to precompile. var unorderedc = from
Have been trying the whole day long and googled the **** out of the
Have looked so long for a library specialized in dealing with iPhone Accelerometer but
Have converted devise new session from erb to Haml but doens't work, this is

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.