Jump to content



Welcome to KnowledgeSutra - Dear Guest , Please Register here to get Your own website. - Ask a Question / Express Opinion / Reply w/o Sign-Up!
- - - - -

Cron Job

php cron job php cron job php trigger

1 reply to this topic

#1 dhi

    Newbie

  • Kontributors
  • Pip
  • 6 posts

Posted 19 December 2011 - 05:19 AM

hello phpgeeks, I have created a php file which i want to run in the background even if my site is not used by any1. How to add this file in cron job using c-panel of linux hosting.

#2 Quatrux

    Privileged Member

  • Kontributors
  • PipPipPipPipPipPipPipPipPip
  • 605 posts
  • Gender:Male
  • Location:Lithuania, Vilnius
  • Interests:Programming
  • myCENT:49.19

Posted 28 December 2011 - 10:19 AM

Go to CPanel of your hosting and in the menu Advanced you can see a section called Cron jobs, push on it.

Set when you want it to work, the period of time, by common settings you will understand how it works. The command run by the cron job must be a valid command.

So here are some methods which could work:

wget -O /dev/null http://www.yoursitename.com/cron.php >/dev/null
GET http://www.example.com/cron.php > /dev/null

or just put the document root path to file and it should work as you may not have the permissions to run some commands:

/home/YOURUSER/public_html/cron.php




Reply to this topic


This post will need approval from a moderator before this post is shown.

  


1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users