Results 1 to 6 of 6

 

Thread: Can u call a script from another hosts cron job?

  1. #1
    Home is where I hang my @

    Status
    Offline
    Join Date
    Sep 2003
    Location
    My Bedroom
    Posts
    412
    Thanks
    0
    Thanked 0 Times in 0 Posts


    Hi,

    I have 1 host with cron, another without.

    I want to have a timed event (on Host A) that calls a script on my on other host (Host B) , preferably with PHP.

    Is it as easy as just calling a local php script on Host A with a cron which then runs an include script that calls the script on Host B?

    I have read about 'wget' - does anybody know about that?

    Thanks

    Daniel

  2. #2
    ShagaaDaggaDoo

    Status
    Offline
    Join Date
    Aug 2003
    Location
    Surrey
    Posts
    1,150
    Thanks
    0
    Thanked 9 Times in 6 Posts
    If the script runs by loading the page then you can use wget ie

    wget http://www.mydomain.com/myscript.php

    All your doing is just loading the page ie the same as if you browsed that page in a web browser.

    Yes , you can run that from any machine.

  3. #3
    Registered User

    Status
    Offline
    Join Date
    Dec 2004
    Posts
    45
    Thanks
    0
    Thanked 0 Times in 0 Posts
    fopen could also be another thing to try...something like:

    fopen("http://yoursite/cron.php", "r")

    http://www.php.net/fopen

    Think that wget would be better tho...just another option

  4. #4
    Registered User

    Status
    Offline
    Join Date
    Aug 2003
    Posts
    661
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I had the same dilema, and through cpanel and with a little help, I was able set up the cron job to run the script, even though it was in a password protected directory.

  5. #5
    Home is where I hang my @

    Status
    Offline
    Join Date
    Sep 2003
    Location
    My Bedroom
    Posts
    412
    Thanks
    0
    Thanked 0 Times in 0 Posts
    OK thanks,

    So I can try either 'fopen' or 'wget'.

    Do I have to install 'wget' or should it already be installed via PHP or Unix/Apache?

    Thanks

    Daniel

  6. #6
    Registered User

    Status
    Offline
    Join Date
    Dec 2004
    Posts
    45
    Thanks
    0
    Thanked 0 Times in 0 Posts
    wget is a standard UNIX command



Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Backing up mysql using cron job
    By scifind in forum Programming
    Replies: 1
    Last Post: 25-04-05, 06:42 PM
  2. Can I run a php script as a cron job?
    By rogerlittin in forum Programming
    Replies: 9
    Last Post: 17-12-03, 10:20 PM

Bookmarks

Posting Permissions

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

Content Relevant URLs by vBSEO 3.5.0 RC2