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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T03:59:14+00:00 2026-06-03T03:59:14+00:00

I am using cronjob to activate a php script. Although when i do it

  • 0

I am using cronjob to activate a php script. Although when i do it manually from the browser, the script takes 3-4 seconds to load and it outputs result into the database.

When cron job does it, it seems that the script is unable to complete in the alloted time and the cronjob stops loading the script mid way, the cron works about 1/10 of the time, the rest 9/10 times it fails to complete the task. Is there a way i can ensure that the script is loaded completely each time the cron job activates it?

Script is simple completely php based. Any suggestions?

  • 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-03T03:59:16+00:00Added an answer on June 3, 2026 at 3:59 am

    I’d suggest implementing a lockfile (overrun protection) solution. Basically when your script kicks off it will do a check for a lockfile, and if the lockfile exists, the script can assume the previous incantation is still running, so it will halt execution. And when the script is complete it will remove the lockfile so subsequent runs can get passed the lockfile check and execute in their entirety.

    A lock file usually contains the process id spawned by the script and usually located somewhere like /var/lock/my_script.lock.

    You can google around for more info, but here is a site with a lockfile example.

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

Sidebar

Related Questions

I'm using PHP, Oracle and crontab. Crontab is invoking a php script, which is
I'm using php to take xml files and convert them into single line tab
I'm currently working on a reminder PHP Script which will be called via Cronjob
I'm planning to sync 2 folders from 2 dyfferent servers using a cronjob scheduled
How would I make my server run a php script by triggering it manually
I'm using a method outline by gregor ( Create cronjob with Zend Framework )
Using PHP, I can convert MySQL data or static table data to csv, Excel,
I'm using fsockopen on a small cronjob to read and parse feeds on different
My Environment: I'm using: OpenSuse 11.4 kernel 2.6.x.x; Apache 2.2; PHP 5.3; MySQL 5.5
I need to set up a cronjob that would run some ruby script 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.