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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T21:52:26+00:00 2026-06-02T21:52:26+00:00

I have a simple bash script which calls a php script every 10 minutes

  • 0

I have a simple bash script which calls a php script every 10 minutes thats performs some maintenance. Every once in a while this php script terminates while it’s running and when this happens the bash script exits.

I’d like to make it so the bash script keeps on looping even if the php script falters. Can anyone point me in the right direction? I’ve been searching for a while but I can’t seem to find the answer, maybe I’m not using the right search terms.

#!/bin/sh
set -e    
while :    
do    
    /usr/bin/php /path/to/maintenance/script.php
    sleep 600    
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-06-02T21:52:29+00:00Added an answer on June 2, 2026 at 9:52 pm

    The:

    set -e
    

    line sets the shell’s “exit on error” flag, which tells it that if a program it runs exits with a non-zero status, the shell should also exit:

    set -e
    false
    echo if this prints, your shell is not honoring "set -e"
    

    There are exceptions for programs whose status is being tested, of course, so that:

    set -e
    if prog; then
        echo program succeeded
    else
        echo program failed
    fi
    echo this will still print
    

    will work correctly (one or or the other echo will occur, and then the last one will as well).

    Back in the Dim Time, when /bin/sh was non-POSIX and was written in Bournegol, there was a bug in some versions of sh that broke || expressions:

    set -e
    false || true
    echo if this prints, your shell is OK
    

    (The logic bug applied to && expressions internally as well, but was harmless there, since false && anything is itself false which means the whole expression fails anyway!) Ever since then, I’ve been wary of “-e”.

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

Sidebar

Related Questions

I have a simple python script which calls 6 threads and for some reason
I have written a simple script that calls a function in a while loop.
I have a simple test bash script which looks like that: #!/bin/bash cmd=rsync -rv
I have written a very simple bash script to help me migrate from dev
I have a bash script that simply calls different calls and redirect stdout and
I'm trying to write a simple bash script which should copy all files with
I have a bash script which I'm reading the results from in my program.
I have a bash script that tests whether the sftp connection exists, very simple
I have a bash script which takes a single argument and returns around 8-10
I have a simple bash script, called print_code.sh , that takes a file name,

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.