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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T16:10:02+00:00 2026-05-11T16:10:02+00:00

I have a file update.php which does some MySQL operations. A cron job executes

  • 0

I have a file “update.php” which does some MySQL operations. A cron job executes this file every 5 minutes. Unfortunately, I cannot execute the cron job more often.

So I had the idea that I could add …

<html>
<head>
  <meta http-equiv="refresh"  content="2; URL=<?php echo $_SERVER['SCRIPT_NAME']; ?>" />
</head>
<body></body>
</html>

… to the page “update.php“. Will cron execute the file in a way that the page will refresh automatically? Or will that not happen because there is no client with a browser?

If it the meta refresh has no effect, is there any other possibility to achieve the refreshing of the page?

Thanks in advance!

  • 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-11T16:10:03+00:00Added an answer on May 11, 2026 at 4:10 pm

    I’m afraid that won’t work, because it’s a browser feature to refresh the page.

    Question: Why can’t you set the cron job to run more frequently that every 5 minutes?

    If there is no other option then you could create you’re own daemon to do the job more frequently.

    e.g.
    Your php script could:

    • Run
    • Wait 60 seconds
    • Run
    • ( Wait; Run; two more times)
    • exit

    For example: (By variation of sshow‘s code)

    <?php
    
    $secs = 60;
    
    ignore_user_abort(true);
    set_time_limit(0);
    
    dostuff();
    sleep($secs);
    dostuff();
    sleep($secs);
    dostuff();
    sleep($secs);
    dostuff();
    sleep($secs);
    dostuff();
    
    ?>
    

    This version of the script will remain resident for four minutes, and execute the code 4 times which would be equivalent to running every minute, if this script is run by cron every 5 minutes.

    There seems some confusion about what a cronjob is, and how it is run.

    cron is a daemon, which sits in the background, and run tasks through the shell at a schedule specified in crontabs.

    Each user has a crontab, and there is a system crontab.

    Each user’s crontab can specify jobs which are run as that user.

    For example:

    # run five minutes after midnight, every day
    5 0 * * *       $HOME/bin/daily.job >> $HOME/tmp/out 2>&1
    # run at 2:15pm on the first of every month -- output mailed to paul
    15 14 1 * *     $HOME/bin/monthly
    # run at 10 pm on weekdays, annoy Joe
    0 22 * * 1-5    mail -s "It's 10pm" joe%Joe,%%Where are your kids?%
    23 0-23/2 * * * echo "run 23 minutes after midn, 2am, 4am ..., everyday"
    5 4 * * sun     echo "run at 5 after 4 every sunday"
    

    So to run every five minutes:

    */5 * * * *     echo "This will be run every five minutes"
    

    Or to run every minute:

    * * * * *       echo "This will be run every minute"
    

    The output from the commands are emailed to the owner of the crontab (or as specified by MAILTO).
    This means if you run something every minute it will email you every minute, unless you ensure all normal output is suppressed or redirected.

    The commands are run as the user who owns the crontab, which contrasts with the scripts run by the web-server, which are run as the ‘nobody’ user (or similar – whatever the web-server is configured to run as).
    This can make life more complicated if the cronjob is writing to files which are supposed to be accessed by the scripts run by the web-server. Basically you have to ensure that the permissions remain correct.

    Now, I’m not sure that this is the system you are refering to. If you mean something else by cronjob then the above might not apply.

    If you want to do something that your current host is not letting you do, then rather than hacking around the restriction, you might what to look at switching hosting provider?


    An alternative is to put the script in you’re normal scripts location, and have some external scheduler run wget against it at whatever frequency you like.


    Another alternative is on-demand updating of the form of vartec‘s suggestion. However that may not solve your problems.

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

Sidebar

Ask A Question

Stats

  • Questions 86k
  • Answers 86k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Google will certainly provide a wealth of articles. I don't… May 11, 2026 at 5:20 pm
  • Editorial Team
    Editorial Team added an answer You need to create a tc-config.xml config file as described… May 11, 2026 at 5:20 pm
  • Editorial Team
    Editorial Team added an answer I suspect that this has everything to do with the… May 11, 2026 at 5:20 pm

Related Questions

I've installed various PHP packages to be able to use PHP with Apache but
I'm trying to implement some kind of caching in a PHP script that will
My question is how does one abstract a database connection from the model layer
I am retrieving XML from a web service and then loading it into MiniXml
Say I have a game in PHP which is a money making game and

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.