Search code examples
croncron-task

Very simple cron job line


I've never written a cron job cmd before in my life, and I want to make sure its right before I run it on my site so nothing messes up.

There is a json feed that my script autopost.php grabs and adds to my database. Usually I just point my browser to the file so it runs and updates the database but I hear cronjobs can do that automatically for me. Would this be correct?

wget -O http://www.domain.com/autopost.php 

EDIT:

Okay with your help I got it working. However it only work when I added /dev/null after wget -O Why is that?


Solution

  • You're missing the run schedule part of the cron command. you need something like this:

    * * * * * wget -O http://www.domain.com/autopost.php 
    

    That says "do a wget every minute. For the syntax, see: http://www.adminschoice.com/crontab-quick-reference