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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T23:35:51+00:00 2026-05-16T23:35:51+00:00

I am running a cron job every five minutes which calls a php script

  • 0

I am running a cron job every five minutes which calls a php script to check to see if users have imported any files for processing.

When I run the php script by going to the address in my web browser it runs the script and then sends the user a notification by email. When I run the script using the cron job, the script works fine, but it doesn’t send the user an email. Any thoughts about why no email is sent?

I’m running Ubuntu Hardy LTS. The cron job is:

*/5 * * * * /usr/bin/wget -–delete-after http://www.mywebsite.com/import_processing.php >/dev/null 2>&1

I’m using delete-after so that I don’t get copies of the script piling up in my server directory. I’m suppressing output and errors also as I don’t need email confirmation myself.

The script uses the basic mail function, and as I said, works just fine when run from my browser.

Update: It looks like the issue is my php script is looking for a browser cookie to send the email. I imagine I’ll have to find another way to get the user’s identity.

  • 1 1 Answer
  • 1 View
  • 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-16T23:35:51+00:00Added an answer on May 16, 2026 at 11:35 pm

    run it like this

    */5 * * * * /usr/bin/php /var/www/htdocs/blah/blah/import_processing.php >/dev/null 2>&1
    

    when you use wget you are downloading the file,
    with php you are running the file,
    test your script running

    /usr/bin/php /var/www/htdocs/blah/blah/import_processing.php >/dev/null 2>&1
    

    using the local path, just in case run

    $ which php 
    

    to figure out where it is installed

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

Sidebar

Related Questions

I have a cron job running a PHP script every five minutes; the PHP
I'm running a cron job (every 15 minutes) which takes about a minute to
I have cron job - php script which is called one time in 5
I have a cron job running searching Twitter every 5 minutes, each 5 minutes
i have created a cron job which is run every 5 minutes. but when
I have a table with 200 rows. I'm running a cron job every 10
I have couple of php scripts which are called by cron. The cron job
I have one domain that is running a cron job every 15mins. I starts
I have a php script that needs to run once every 5 minutes. Currently
I have a cron job which needs running on my site. I have set

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.