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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T09:20:32+00:00 2026-05-27T09:20:32+00:00

I created a cronjob which call a php-script every 5mins. This PHP script needs

  • 0

I created a cronjob which call a php-script every 5mins.

This PHP script needs to start several other PHP CLI scripts and keep them running in background even when the cron-script terminates.

I’m currently creating these sub-processes by the following line of code:

if (!$pid = shell_exec("nohup /var/[..]/cake.php test doSomething > /dev/null 2>&1 & echo $!")) return false;  

When I call the “motherscript” via command-line everything’s working great. But it seems like the sub-processes startet by the above line of code are terminated when the cron-job stops.

So how to spawn these cake.php test doSomethingscript and keep the child-process running under the predefined user in crontab?

  • 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-27T09:20:33+00:00Added an answer on May 27, 2026 at 9:20 am

    That makes sense, you need to tell the children PHP scripts to NOT terminate when it’s parent stops.

    ignore_user_abort(true);
    

    Add the above line to the children PHP scripts. Should do it

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

Sidebar

Related Questions

I have created a cron job for my website which runs every 2hours and
I have cron job - php script which is called one time in 5
Well, I have created a python script, which checks the number of uncompleted tasks
Just to learn, I've created an unlimited loop function which is like below: <?php
I created a program using dev-cpp and wxwidgets which solves a puzzle. The user
I'm running a cron job (every 15 minutes) which takes about a minute to
I use PHP and Oracle, with crontab executing the PHP scripts at scheduled times.
I'm trying to create a cronjob to back up my database every night before
Update: I wrote a working script that finishes this job in a reasonable length
I have created a system that will be calculating data every month based on

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.