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 6812509
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T20:27:28+00:00 2026-05-26T20:27:28+00:00

In my crontab file I execute a script like so (I edit the crontab

  • 0

In my crontab file I execute a script like so (I edit the crontab using sudo crontab -e):

01 * * * * bash /etc/m/start.sh

The script runs some other scripts like so:

sudo bash -c "/etc/m/abc.sh --option=1" &
sleep 2
sudo bash -c "/etc/m/abc.sh --option=2" &

When cron runs the script start.sh, I do ps aux | grep abc.sh and I see the abc.sh script running.

After a couple of seconds, the script is no longer running, even though abc.sh should take hours to finish.

If I do sudo bash /etc/m/start.sh & from the command line, everything works fine (the abc.sh scripts run for hours in the background until they complete).

How do I debug this?

Is there something I’m doing that is preventing these scripts from running in the background until they are done?

  • 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-26T20:27:29+00:00Added an answer on May 26, 2026 at 8:27 pm

    The program(s) you’re starting might be expecting a terminal to send their output to, or receive input from.

    If you set the MAILTO= variable, and you have a sendmail(-like) daemon installed, you will get an email with the error message(s) it prints, if there are any:

    MAILTO=your@email.address.here.com
    01 * * * * bash /path/to/something.sh
    

    Another way to debug would be to run the script from the command line, while redirecting all inputs and outputs:

    $ sudo bash -c "foo.sh" > output_file 2>&1 < /dev/null
    

    Also, the system log files (usually found in /var/log) might contain useful hints.

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

Sidebar

Related Questions

I'm trying to run a test script using crontab within Plesk. The php file
I'm trying to execute a Python script using the Linux crontab . I want
How can I set up my crontab to execute X script at 11:59PM every
I have a bash script activated by crontab and running in background. I would
Is it possible to execute from crontab a php file inside a folder which
I have a script that runs on the command line, called by a crontab.
I am using crontab to run a python script that requires the module MySQLdb.
I have a php file that contains class which runs some lengthy database operations.
I have setup a cronjob in etc/crontab file as shown below */1 * *
I have a crontab job calling a python script and outputting to a file:

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.