cron jobs in PHP admin to run a PHP file

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • JRough

    cron jobs in PHP admin to run a PHP file

    I want to run a php script every day. The page goes to a directory
    and
    parses a file and adds data to the database. Where it says "command"
    in cron jobs I don't know what it is looking for? Can I put the name
    of my php file?

    This is what I have:

    Minute Hour Day Month Weekday Command
    1 8 1-7 1-31
    * myPage.php

    The reason I am asking is I don't have a clue what PHPadmin wants in
    the command box. All I want to do is run the php script.

    Thanks,
    janis


  • Paul Lautman

    #2
    Re: cron jobs in PHP admin to run a PHP file

    JRough wrote:
    >I want to run a php script every day. The page goes to a directory
    and
    parses a file and adds data to the database. Where it says "command"
    in cron jobs I don't know what it is looking for? Can I put the name
    of my php file?
    >
    This is what I have:
    >
    Minute Hour Day Month Weekday Command
    1 8 1-7 1-31
    * myPage.php
    >
    The reason I am asking is I don't have a clue what PHPadmin wants in
    the command box. All I want to do is run the php script.
    >
    Thanks,
    janis
    usually you would put the path to the php interpreter followed by any
    required options followed by the script file name


    Comment

    • BravoFoxtrot

      #3
      Re: cron jobs in PHP admin to run a PHP file

      On May 27, 12:17 pm, JRough <jlro...@yahoo. comwrote:
      I want to run a php script every day. The page goes to a directory
      and
      parses a file and adds data to the database. Where it says "command"
      in cron jobs I don't know what it is looking for? Can I put the name
      of my php file?
      >
      This is what I have:
      >
      Minute Hour Day Month Weekday Command
      1 8 1-7 1-31
      * myPage.php
      >
      The reason I am asking is I don't have a clue what PHPadmin wants in
      the command box. All I want to do is run the php script.
      >
      Thanks,
      janis
      You will want something like
      01 8 * * * /usr/bin/php /<full_path>/myPage.php

      I believe this will run daily at 8:01 and it will execute your php
      page.

      Comment

      • Jerry Stuckle

        #4
        Re: cron jobs in PHP admin to run a PHP file

        JRough wrote:
        I want to run a php script every day. The page goes to a directory
        and
        parses a file and adds data to the database. Where it says "command"
        in cron jobs I don't know what it is looking for? Can I put the name
        of my php file?
        >
        This is what I have:
        >
        Minute Hour Day Month Weekday Command
        1 8 1-7 1-31
        * myPage.php
        >
        The reason I am asking is I don't have a clue what PHPadmin wants in
        the command box. All I want to do is run the php script.
        >
        Thanks,
        janis
        >
        >
        The program needs to be your PHP CLI executable. Parameter should be
        -f <your script filename>

        (You can leave out the -f - but I leave it in for clarity).

        Ensure the cron user has permission to execute your php executable and
        read access to the script (plus the appropriate access to any other
        resources required).


        --
        =============== ===
        Remove the "x" from my email address
        Jerry Stuckle
        JDS Computer Training Corp.
        jstucklex@attgl obal.net
        =============== ===

        Comment

        • JRough

          #5
          Re: cron jobs in PHP admin to run a PHP file

          On May 27, 11:32 am, "Paul Lautman" <paul.laut...@b tinternet.com>
          wrote:
          JRough wrote:
          I want to run a php script every day. The page goes to a directory
          and
          parses a file and adds data to the database. Where it says "command"
          in cron jobs I don't know what it is looking for? Can I put the name
          of my php file?
          >
          This is what I have:
          >
          Minute Hour Day Month Weekday Command
          1 8 1-7 1-31
          * myPage.php
          >
          The reason I am asking is I don't have a clue what PHPadmin wants in
          the command box. All I want to do is run the php script.
          >
          Thanks,
          janis
          >
          usually you would put the path to the php interpreter followed by any
          required options followed by the script file name
          SO the php interpreter would be normally be in my http docs somewhere
          under where I installed php
          but this server is web hosted so I'm assuming it is the url I use to
          run the scirpt in my browser.
          thanks,

          Comment

          • Paul Lautman

            #6
            Re: cron jobs in PHP admin to run a PHP file

            JRough wrote:
            On May 27, 11:32 am, "Paul Lautman" <paul.laut...@b tinternet.com>
            wrote:
            >JRough wrote:
            >I want to run a php script every day. The page goes to a directory
            and
            parses a file and adds data to the database. Where it says
            "command" in cron jobs I don't know what it is looking for? Can I
            put the name of my php file?
            >>
            This is what I have:
            >>
            Minute Hour Day Month Weekday
            Command 1 8 1-7 1-31
            * myPage.php
            >>
            The reason I am asking is I don't have a clue what PHPadmin wants
            in the command box. All I want to do is run the php script.
            >>
            Thanks,
            janis
            >>
            >usually you would put the path to the php interpreter followed by any
            >required options followed by the script file name
            >
            SO the php interpreter would be normally be in my http docs somewhere
            under where I installed php
            but this server is web hosted so I'm assuming it is the url I use to
            run the scirpt in my browser.
            thanks,
            You assume incorrectly. Your hosting company should tell you what the path
            is (it is usually the path that BravoFoxtrot mentioned). They may have it in
            a faq somewhere.


            Comment

            Working...