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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T20:12:48+00:00 2026-05-13T20:12:48+00:00

I have a php script I want to run every minute to see if

  • 0

I have a php script I want to run every minute to see if there are draft news posts that need to be posted. I was using “wget” for the cron command in cPanel, but i noticed (after a couple days) that this was creating a blank file in the main directory every single time it ran. Is there something I need to stop that from happening?

Thanks.

  • 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-13T20:12:48+00:00Added an answer on May 13, 2026 at 8:12 pm

    When wget runs, by default, it generates an output file, from what I need to remember.

    You probably need to use some option of wget, to specify to which file it should write its output — and use /dev/null as destination file (It’s a “special file” that will “eat” everything you can write to it)

    Judging from man wget, the -O or --output-file option would be a good candidate :

    -O file

    --output-document=file

    The documents will not be written to the appropriate files, but all will be concatenated together and written to file.

    so, you might need to use something like this :

    wget -O /dev/null http://www.example.com/your-script.php
    

    And, btw, the output of scripts run from the crontab is often redirected to a logfile — it can always help.

    Something like this might help, about that :

    wget -O /dev/null http://www.example.com/your-script.php >> /YOUR_PATH_logfile.log
    

    And you might also want to redirect the error output to another file (can be useful, to help with debugging, the day something goes wrong) :

    wget -O /dev/null http://www.example.com/your-script.php >>/YOUR_PATH/log-output.log 2>>/YOUR_PATH/log-errors.log
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a html_headers.inc.php script that I want to include in every script on
I want to run a cron job every minute that will launch a script.
I have a PHP script that run on cron every 5 minutes. */5 *
I have a series of PHP scripts that I want to run in a
I have a php script that is running in CLI and I want to
I have an multi-dimensional array that I want to send to a PHP script
I have a PHP script that and at a certain point i want to
I want to run a php script on christmas that will email my family
I have a php script that resides in a single folder I want to
I get some data from an PHP-Script via AJAX and want to have the

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.