Browse > Home / Webmaster Tutorials / Cronjobs in Directadmin

| Subcribe via RSS

Cronjobs in Directadmin

May 30th, 2009 Posted in Webmaster Tutorials

Lately ive started to use cronjobs more and more for the main reason that I want to use cached pages that are high on server load. It’s now almost 1AM and I wanted to fix my cronjob because it wasn’t done and It was a very stupid mistake. I forgot to CHMOD the .php file to 777. Therefor I am going to write this short guide on how you successfully need to setup a cronjob in directadmin.

To use a cronjob you need a file (I use a php file in my example to explain) that has some commands in it that you want to be automated. We will use cronfile.php. Let’s say it is located in website.com root public_html folder.

First thing you need to do is open directadmin and go to here: http://YOUR_IP:2222/CMD_CRON_JOBS

The page will look like this:

Direct Admin Image

As you can see there is 1 cron job that is currently running. In the command line you need to put the path to your PHP file. It will look like this

/usr/local/bin/php -q /home/*username*/domains/*domain*/public_html/indexcache.php

Replace *username* with your username and *domain* with yoursite.com.

As you can see I have set the cronjob to run every hour of every day on minutes 1,10,20,30,40,50.

The server will run the PHP file every 1,10,20,30,40,50 minute.

In order to make this really work you musn’t forget to CHMOD the PHP file to 777

I hope you learned how to setup a cronjob with this tutorial!

One Response to “Cronjobs in Directadmin”

  1. domain name sales Says:

    domain name sales…

    ITCompany. com. au is a favorite Australian Domain Name Registration provider, IT Solutions and IT Services provider in Australia. ITCompany. com. au can assist you with not only Cheap Domain Names but Email Hosting, Free DNS Hosting, Web Site Hosting,…


Leave a Reply

  • Website of the month

    URL: TemplateZ.org
    Type: vBulletin
    Graphics: 9/10
    Content: 10/10
    Overall: 9.5