How to schedule job on mysql server?

Discussion in 'PHP' started by vipvanlines, Feb 1, 2007.

  1. #1
    hello guys,

    im running script on mysql server with php,

    i have a quastion,

    how to schedule the job timing ?

    thanks,
     
    vipvanlines, Feb 1, 2007 IP
  2. alecs

    alecs Well-Known Member

    Messages:
    156
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    128
    #2
    Use a cron job.
    For example (in Cpanel) go to cron jobs, select the frequency of the command to run and type in:
    /usr/bin/php -q /home/name/public_html/script.php
    I don't know how your server is set up, but this works for me.
     
    alecs, Feb 1, 2007 IP
  3. aplus

    aplus Well-Known Member

    Messages:
    83
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    115
    #3
    or, if you use cmd, type:

    crontab -e

    and type something like:

    5 * * * * /usr/bin/php -q /home/name/public_html/script.php

    if you want your script to run every 5 minutes or

    30 15 * * * /usr/bin/php -q /home/name/public_html/script.php

    if you want your script to run every day at 15:30
     
    aplus, Feb 1, 2007 IP