The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Cron Job to call a Web Page?

Discussion in 'General Discussion' started by redbrad1, Nov 11, 2006.

  1. redbrad1

    redbrad1 Member

    Joined:
    Oct 19, 2006
    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    1
    I have been looking all over the internet and I can not seem to find how to setup CRON to call a web page. I do not want it to just call the page but actually request the URL so it is phrased by the engine.

    Can someone help point me in how to do this?

    Brad
     
    #1 redbrad1, Nov 11, 2006
    Last edited: Nov 11, 2006
  2. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,461
    Likes Received:
    22
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    wget will request a remote web page:

    wget http://www.example.com

    Create a script that calls wget then add the script to cron

    Or use wget directly from cron
     
  3. gupi

    gupi Well-Known Member

    Joined:
    Apr 27, 2004
    Messages:
    125
    Likes Received:
    0
    Trophy Points:
    16
    Try one of these in your crontab:
    Code:
    */15 * * * * /usr/bin/lynx http://www.mydom.ain/page.html > /dev/null
    
    */15 * * * * GET http://www.mydom.ain/page.html > /dev/null
    
     
  4. redbrad1

    redbrad1 Member

    Joined:
    Oct 19, 2006
    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    1
    wget worked great but now I am starting to see files appear in my FTP directory from it calling this script. Is there a way to not have it create a temporary file or to delete the temporary file after its done with it?
     
  5. HelloAdam

    HelloAdam Well-Known Member

    Joined:
    Nov 6, 2005
    Messages:
    145
    Likes Received:
    0
    Trophy Points:
    16
    Hey,

    I use the

    lynx

    function and it works awesome

    Code:
    lynx -dump http://www.CoolLookingSite.com
    
    From,
    Adam
     
  6. redbrad1

    redbrad1 Member

    Joined:
    Oct 19, 2006
    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    1
    Adam,

    This requests a url that you specify and will not create the temporary files?

    Code:
    lynx -dump http://www.CoolLookingSite.com/automated-page.php
    
     
  7. HelloAdam

    HelloAdam Well-Known Member

    Joined:
    Nov 6, 2005
    Messages:
    145
    Likes Received:
    0
    Trophy Points:
    16
    Hey,

    Never did for me. Also where are you seeing these temporary files (what folder)?

    From,
    Ada
     
  8. redbrad1

    redbrad1 Member

    Joined:
    Oct 19, 2006
    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    1
    The files are being stored in /home/accountname/ so the folder looks like below. All the items in red I delete out once a day or whenever I get a chance and of course I didnt feel like listing out all 38 that are currently in the directory :rolleyes:

    .cpanel-datastore
    etc
    mail
    public_ftp
    public_html
    tmp

    .bash_logout
    .bash_profile
    .bashrc
    .contactemail
    .dns
    .emacs
    .gtkrc
    .lastlogin
    .spamkey
    final-ticket-sales.php
    final-ticket-sales.php.1
    final-ticket-sales.php.10
    final-ticket-sales.php.11
    final-ticket-sales.php.12
    final-ticket-sales.php.13
    final-ticket-sales.php.14
    final-ticket-sales.php.15
     
  9. HelloAdam

    HelloAdam Well-Known Member

    Joined:
    Nov 6, 2005
    Messages:
    145
    Likes Received:
    0
    Trophy Points:
    16
    Hey,

    Well using my command, doesn't do that on my end. It could also be a root server setting which could be causing this, however I wouldn't know which one. If worst comes to worst, you can always create another cronjob to delete those files :p

    From,
    Adam
     
  10. redbrad1

    redbrad1 Member

    Joined:
    Oct 19, 2006
    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    1
    Looks like

    Code:
    lynx -dump http://www.CoolLookingSite.com/automated-page.php
    did the trick, and does not create a temporary file. Thanks for your help.
     
Loading...

Share This Page