+ Reply to Thread
Results 1 to 10 of 10

 

Thread: Can I run a php script as a cron job?

  1. #1
    Registered User

    Status
    Offline
    Join Date
    Oct 2003
    Location
    Norfolk
    Posts
    99
    Thanks
    0
    Thanked 0 Times in 0 Posts


    I have put together a small php script that will log onto cj and retrieve a sales report and then read it into mysql.

    What I would like to do with it is run it as a cron job but I ame not sure how to do it.

    Can I run the script directly or do I need to call it from another script?

    any help appreciated.

    Thanks,

    Roger.

  2. #2
    ShagaaDaggaDoo

    Status
    Offline
    Join Date
    Aug 2003
    Location
    Surrey
    Posts
    1,149
    Thanks
    0
    Thanked 9 Times in 6 Posts
    Does the sript run when you access it via the web? ie going to mysite.com/script.php

    If it does then you can let the server open it using wget.

    Something like..

    00 2 * * * wget http://wwwdomain.com/script.php

  3. #3
    Senior Member

    Status
    Offline
    Join Date
    Sep 2003
    Posts
    768
    Thanks
    0
    Thanked 2 Times in 2 Posts
    If you have problems running anything by cron, here is something helpful dug out from my huge favourites list:

    http://www.fastcron.com/

    Basically it is a cheap cron-type service that runs remotely. You tell it what scripts to run and when and it hits them. Used to use this a lot in the days before having my own servers and found it very useful.

  4. #4
    Registered User

    Status
    Offline
    Join Date
    Oct 2003
    Location
    Norfolk
    Posts
    99
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks Aquanuke. I figured there must have been an easy way to do it. Been a lot of years since I messed around with linux and my memory was failing me.

    Works a treat.

    Roger.

  5. #5
    Registered User

    Status
    Offline
    Join Date
    Aug 2003
    Location
    Sunny Scotland
    Posts
    39
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Roger - I run php scripts form the command line with something like:

    /usr/bin/php -q /path/to/script.php

    ... so that would be cron-able.

    Not sure what the -q switch does, but it was in instructions that came with something so I use it (might be for "quiet" mode - suppress output, that's a guess).
    Are You Crazy?

  6. #6
    Registered User

    Status
    Offline
    Join Date
    Aug 2003
    Posts
    204
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Roger,

    I've just checked your posts 'webpage link' and have an issue with a number of copyright infringements on your site.

    Sorry to do this publically but I'm sick and tired of sites showing a blatant disregard for copyright.

    Please go over your privacy policy, FAQ and Terms & Conditions pages and change all the content that you have copied from GreasyPalm.

    I expect all copyright infringements to be resolved within 24 hours before escalating proceedings.

    Neil Durrant
    neil@greasypalm.co.uk

  7. #7
    Super Member

    Status
    Offline
    Join Date
    Sep 2003
    Location
    Manchester
    Posts
    1,066
    Thanks
    2
    Thanked 2 Times in 2 Posts
    neil,

    regardless of the level of copyright infrigement roger may or may not be guilty of (i have no idea and i'm certainly not going to bother checking) your decision to post your complaint on the board and not via email is quite pathetic imho.

    by all means send him a private message, but to go public first is not the way to handle it - unless he is a persistent offender, which he doesn't appear to be by your message.

    still, it makes the decision not to bother with your programme so much easier.

  8. #8
    Registered User

    Status
    Offline
    Join Date
    Oct 2003
    Location
    Norfolk
    Posts
    99
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Neil, sorry for the mixup. I have sent you an email so I won't go into the whats and where fors here.

    Originally posted by jrisby
    still, it makes the decision not to bother with your programme so much easier.
    Don't be to harsh, personally I think that Neil has a great programme.

    Roger.

  9. #9
    Registered User

    Status
    Offline
    Join Date
    Aug 2003
    Posts
    204
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Firstly, Roger, thank you for your personal email. I appreciate your prompt and courteous resolution of these issues.

    JRisby, I'm sorry you felt the post was inapproriate but I don't make any apologies for doing so - it's no more inappropriate than people lacking respect of copyright. I chose to make it clear that such will not be tolerated to ultimately protect the interests of both my company and my affiliate partners.

  10. #10
    Super Member

    Status
    Offline
    Join Date
    Sep 2003
    Location
    Manchester
    Posts
    1,066
    Thanks
    2
    Thanked 2 Times in 2 Posts
    neil,

    you handle your copyright issues as you see fit, obviously.

    as a member of the nuj, and a programmer, i value the copyright in my work and i understand where you are coming from. i just totally disagree with starting a dialogue about infringement in a public forum. but, when you do so, don't be surprised that people other than those directly involved respond and consider your business decisions ill-judged.

    john

+ Reply to Thread


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, 07:42 PM
  2. Feed Insertion PHP script?
    By stevenm in forum Programming
    Replies: 3
    Last Post: 30-12-04, 02:56 PM
  3. eBay Api PHP Script
    By scifind in forum Programming
    Replies: 1
    Last Post: 08-10-04, 04:10 PM
  4. Grabbing script help php 4.3.2
    By Keith in forum Programming
    Replies: 3
    Last Post: 18-08-03, 08:46 AM

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