1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

cron jobs to execute php file?

Discussion in 'PHP' started by Lordy, Mar 23, 2008.

  1. #1
    not sure if this would be the place to post it,

    but how would you setup a cronjob to execute a php file?

    say if i have a file update.php that updates my mysql db, how would i set a cron job to automatically run that file everyday?
     
    Lordy, Mar 23, 2008 IP
  2. nethelp

    nethelp Peon

    Messages:
    389
    Likes Received:
    17
    Best Answers:
    0
    Trophy Points:
    0
    #2
    aim not yet allowed to post active links (I'm too new here), but this can help you: mailm.co.uk/mm/admin/resources/tutorials/cron_intro.html

    Good luck!
     
    nethelp, Mar 23, 2008 IP
  3. Lordy

    Lordy Peon

    Messages:
    1,643
    Likes Received:
    29
    Best Answers:
    0
    Trophy Points:
    0
    #3
    yup, that did help, but i'm still a bit confused about some of the flags, and googling doesn't get me much.

    -q? or is that plesk specific?
     
    Lordy, Mar 23, 2008 IP
  4. shamess

    shamess Well-Known Member

    Messages:
    1,127
    Likes Received:
    25
    Best Answers:
    0
    Trophy Points:
    185
    #4
    The -q means "Run the PHP from this file".
     
    shamess, Mar 23, 2008 IP
  5. Lordy

    Lordy Peon

    Messages:
    1,643
    Likes Received:
    29
    Best Answers:
    0
    Trophy Points:
    0
    #5
    so it means run all the php coding in that file? does that mean it won't run php coding without a -q tag?
     
    Lordy, Mar 23, 2008 IP
  6. shamess

    shamess Well-Known Member

    Messages:
    1,127
    Likes Received:
    25
    Best Answers:
    0
    Trophy Points:
    185
    #6
    Without the -q, it'll have no idea why you're giving it a file. The -q means "I'm about to give you a file, at the times I've just mentioned, run all of this script."
     
    shamess, Mar 23, 2008 IP