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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T22:57:57+00:00 2026-06-15T22:57:57+00:00

I have an mailing list and regurally send information to it. This mailing list

  • 0

I have an mailing list and regurally send information to it.
This mailing list has grown up and now it’s too big to send it at a commercial time because opens too many connections and the server is inaccessible.
So I made a bash script to call a PHP file at night (4AM) that checks if there is any newsletter scheduled to send and if there is, send it.

BASH SCRIPT

#!/bin/sh
senddate=$(date +"%Y-%m-%d")

url=https://www.my.url/check_to_send_maillist.php?date=$senddate\&autosend=1

wget -O /my/log/dest.log --http-user=myuser --http-password=mypass $url

PHP SCRIPT

$date=$_GET["date"];
if($date<>""){
$sql="select newsletters_id from " . TABLE_NEWSLETTERS . " where send_date='" . $fecha . "'";
$nid=executequery($sql);
if($nid<>""){
    $url="https://www.my.url/send_newsletter.php?page=1&nID=%s&action=confirm_send&autosend=1";
    $url=sprintf($url,$nid["newsletters_id"]);
    header('location:' .$url);
}   
}

The tests were OK, and everything I did worked fine. When I used it with the real maillist the PHP script called 3 times to the URL that sends the newsletters so my customers received the newsletter 3 times. My maillist is about 40,000 addresses (yes I know I should use an external service)

Apache log
-BASH SCRIPT

server_ip - http_user [14/Dec/2012:04:00:02 +0100] "GET /check_to_send_maillist.php?date=2012-12-14&autosend=1 HTTP/1.0" 302 - "-" "Wget/1.10.2"


-PHP SCRIPT

 server_IP - http_user [14/Dec/2012:04:04:59 +0100] "GET /my_send_script.php?page=1&nID=nid&action=confirm_send&autosend=1 HTTP/1.0" 200 21454 "-" "Wget/1.10.2"
server_IP - http_user [14/Dec/2012:04:20:01 +0100] "GET /my_send_script.php?page=1&nID=nid&action=confirm_send&autosend=1 HTTP/1.0" 200 21454 "-" "Wget/1.10.2"
server_IP - http_user [14/Dec/2012:06:05:38 +0100] "GET /my_send_script.php?page=1&nID=nid&action=confirm_send&autosend=1 HTTP/1.0" 200 268 "-" "Wget/1.10.2"


Why is the header location making multiple calls to the script? How can I force to make just one call?
Any suggestion to do it in a different way?.

Any help will be appreciated

  • 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-15T22:57:59+00:00Added an answer on June 15, 2026 at 10:57 pm

    After hole day looking for reason and/or solution for the problem I found it.
    By default WGET tries 20 times to open the URL if it gives a timeout.
    My script sends the emails was giving a timeout and so WGET tried again and again.

    I chaged the WGET command to

    WGET -tries=1 -T 4 http://www.my.url/my/script.php
    

    –tries=1 forces WGET to try just once to open the script, even if gives timeout.
    -T 4 set the timeount to 4 seconds

    And worked fine.

    Thanks for the help.

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

Sidebar

Related Questions

(This question is asked on Maven User mailing list too) I have recently faced
we have a vb.net application with send and receive mailing also. Now we have
I have seen this question being asked multiple times on the R mailing list,
I posted this in the mailing list, but the reply I got wasn't too
I posted this on the pygame mailing list but maybe someone here will have
I have asked this question at various places, including the OpenMPI mailing list. So
Note: I have also asked this question on the AutoMapper mailing list My MVC
This will be cross posted on R's mailing list. I have the map as
I have from time to time heard mention of a mailing list or lists
I have seen documentation on the IronPython mailing list that describes how to write

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.