The forums have permanently moved to This forum will be kept around in read-only mode for archival purposes. To learn how to continue using your existing account on the new forums, check out this thread.

Results 1 to 5 of 5

Thread: Have function running every hour - php

  1. #1

    Have function running every hour - php

    Hi everyone,

    I am not sure if my subject tells it well but i wanna create a function which will run every day or every hour to check my DB and update my Information instead of going everyday and manually check it which will consume too much time.

    Does anybody can help me in that please.

    Thanks for any help.



  2. #2
    hugeExplosions = true;

    Check the last reply, don't know if that actually works, but someones done it - guess it uses cron
    MS Paint FTW!

  3. #3
    Linux only

    1) Save the script you would like to run every hour on the server
    2) Open cron with crontab -e
    3) Add the following line (replace COMMAND with the command to execute the code)

    0 * * * * COMMAND >/dev/null 2>&1
    4) save it (a message will display: 'crontab: installing new crontab')

    done ! the script will now run every hour, more information on the crontab syntax can be found here

    You can never underestimate the stupidity of the general public.

  4. #4
    Thanks for the replies guys,
    I was wondering, im using joomla cms based and is it a good pratice to make a function which will run for e.g. every day at 00:00 to read/delete data in a DB???!!! Or should i stick with the mvc system where i will use the controller to take care of the task which means that i will have to go and instantiate that function every time i log in for e.g. on my system.

    Thanks a lot.


  5. #5
    Depends on the scripts purpose... if you really need to execute it at a specific time, use crontab (backups etc)...

    You can never underestimate the stupidity of the general public.

Thread Information

Users Browsing this Thread

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

Posting Permissions

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

Home About Meet the Moderators Advertise

 Link to Us


Copyright 1999 - 2012