Find the answer to your Linux question:
Results 1 to 10 of 10
Hi all I wanna try to run a auto e-mail member for birthday, I have a mode manuelly installed and it is running seamlessly When I put below URL to ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Oct 2011
    Posts
    5

    Question CronJob Run/Call URL Problem


    Hi all
    I wanna try to run a auto e-mail member for birthday,
    I have a mode manuelly installed and it is running seamlessly
    When I put below URL to the browser and hit to ENTER it runs and send e-mail to the members (controlled)

    mysite.com/forum/index.php?action=birthday

    this URL running;

    What I want to do is that;
    I wanna run a CronJob daily at 08:00 which launchs this URL

    There is no problem with scheduling
    But I tear my hair what is the correct command?

    wget -q mysite.com/index.php?action=birthday

    Any idea?

    Cant write exact URL: You are only allowed to post URLs to other sites after you have made 15 posts or more.


    Any idea?

  2. #2
    Trusted Penguin
    Join Date
    May 2011
    Posts
    4,353
    Does that wget command not work, i.e., does it not send the email? I made a simple php script that accepts arguments and did a wget of it and it worked just fine.

    Post wget output, if anything there is helpful. Is there anything in the apache log (usually /var/log/httpd/error_log) or the cron log (usually /var/log/cron)?

  3. #3
    Just Joined!
    Join Date
    Oct 2011
    Posts
    5
    If i put this line to the command field

    wget -q /home/mysite/public_html/forum/index.php action=dogumgunu

    CronTab says: AJAX Error
    Please refresh the page and try again.

  4. #4
    Trusted Penguin
    Join Date
    May 2011
    Posts
    4,353
    Aren't you running a local webserver? Otherwise, there's no point in using wget. If you start a webserver (assuming you have one installed and configured w/PHP), then try:

    Code:
    wget -q http://www.YourDomain.com/forum/index.php action=dogumgunu
    Does that give you the same response?

    However, if there are AJAX errors...then does the page need to be dynamic/require user interaction for the email to be sent?

  5. #5
    Just Joined!
    Join Date
    Oct 2011
    Posts
    5
    I am using my webserver (Not local)

    Same Ajax Eror returns for your last command (The command that you wrote your last message)

    PS: I hate this message: You are only allowed to post URLs (http, ftp, @) to other sites after you have made 15 posts or more.
    WHYYYYYY?

  6. #6
    Trusted Penguin
    Join Date
    May 2011
    Posts
    4,353
    Just use hxxp instead of http.

    Can you answer my other question: does the webpage require user interaction in order to send the email? If not, what is AJAX doing in the page that is required?

    If the page must be loaded in a browser to work, you could run an X virtual frame buffer, and run firefox using --display= to point to the frame buffer display and pass the URL to it.

  7. #7
    Just Joined!
    Join Date
    Oct 2011
    Posts
    5
    First of all I am using SMF forum, (simplemachines.org)
    a php file (with scripts) sending birhtday email to the users/members
    There is a file in forum/sources folder (named dogumgunu.php)
    Within this file;
    <?php
    function DogumGunu ()
    {
    loadTemplate('Dogumgunu');
    }
    ?>
    The path of Dogumgunu php file is .../forum/themes/default/Dogumgunu.template.php

    So, finally when I execute/run this URL [qqq.mysite.com/forum/index.php?action=dogumgunu] it sends email
    It is manuelly...

    Does it an answer for your qoestion?

  8. #8
    Trusted Penguin
    Join Date
    May 2011
    Posts
    4,353
    Do you have to log in to the SMF page first, before loading your birthday page? I thought this was a webserver under your control...you may not be able to do this, as the client/server interaction provided by the browser is likely required for you to load the page properly.

    A way to test that might be to just run firefox (assuming that is your browser) from the command line, loading the URL. First close all instances of your browser (and clear the cache too). Then run it from the command line:

    Code:
    firefox http://mysite.com/forum/index.php?action=dogumgunu
    Does that work as expected, w/o interacting w/the page at all?

  9. #9
    Just Joined!
    Join Date
    Oct 2011
    Posts
    5
    No error log (I cant find)

    When I put this command to the Crontab Command field

    Code:
    firefox hxxx://qqq.mysite.com/forum/index.php?action=dogumgunu
    An e-mail arrived with this message
    /bin/sh: firefox: command not found

  10. #10
    Trusted Penguin
    Join Date
    May 2011
    Posts
    4,353
    Yeah, the apache error log is only for checking if you are running a local webserver - disregard.

    Where is firefox installed? Is firefox what you are using to browse SMF?

    Do this:
    Code:
    which firefox
    It is probably /usr/bin/firefox, but maybe not. Anyway, it is always good practice to use the full path to your commands/scripts/program in your cronjob.

    But, I would not put firefox in your cronjob in the first place. Just run that command from the terminal to see if it works at all.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •