Cron setup with Directadmin interface

Discussion in 'Linux VPS - DirectAdmin' started by onelove, Nov 5, 2006.

  1. onelove

    onelove New Member


    I have a php script which I would like to be called everyday at 6am for 5 minutes.

    Any ideas on how to do this with the Directadmin interface?

    I've tried this (space between php and /home)
    1-5 6 * * * /usr/local/bin/php /home/USER/domains/DOMAIN/mailer/crons.php

    I've also tried this as suggested by support
    wget -q -O /dev/null > /dev/null

  2. Leomania

    Leomania New Member

    onelove, which problem are you having -- that you don't see the place under DirectAdmin to add a cron job, or did you find that but it's not working?

    If it's the former, try this. While logged in as the user for, you should see "Cron jobs" under the "Advanced Options for" section. Once in there you can add/delete cron jobs for that domain.

    If it's the latter, you'll probably need to do some debugging from the command line to find out what's going on. I assume that you can only run cron jobs as your DirectAdmin user by setting it up via DA, so if the command needs to be run as root then you'll need to make it part of root's cron instead.

    Hope that helps,

    - Leo
  3. onelove

    onelove New Member

    Code to call a script using CRON

    Thanks for the info Leo. Here's what I am using to call a phpscript using Directadmin cronjob settings

    wget -q -O /dev/null > /dev/null
  4. compwhizmm

    compwhizmm New Member

    Can't get it to work either

    Hi, I'm also trying to get a cron job going. Here is what I have entered into my direct admin control panel:

    /usr/local/lib/php /home/s*****/domains/s*********.com/public_html/loadavg/logger.php

    I entered a 6 in the minutes field, because it has to be run every 6 minutes. However, the script is never run. Can someone assist me?

    Thank you!
  5. rezag

    rezag New Member

    What are you getting as the output? Are you sure that you have you set up the loadavg properly with the beanc helper? I say that because I never could get it working for some reason (I am on a Plesk VPS, though that shouldn't make a difference other than PHP and other paths which I believe yours is right)
  6. Bryan

    Bryan Very Happy KH VPS User

    I had the same problem in cPanel actually. It finally just started working on its own. I literally changed nothing and it just started working the next day. Go figure. :)
  7. rezag

    rezag New Member

    Do you mean the second day after setting it up? I guess in your case the note on the loadavg developer's site applies

    but mine didn't work at all...
  8. Dan

    Dan Moderator

    Why would you want a script to only run for 5 minutes rather than running to completion? I've never seen and am not sure that you can have '1-5' in a cron schedule. Does it actually save the cronjob?

    I would say to test your command in SSH to insure that it's correct first and then work on the schedule which I would think would be '* 6 * * *' so that it would simply run every day at 6:00 AM every day.

    You should be able to look in your cron log as well which you should be able to find in /var/log/cron.

    Hope that helps
  9. Jleagle

    Jleagle New Member

    Yes, why 5 minutes exactly? Surely you want the script to run once and its done when its done.
  10. Bryan

    Bryan Very Happy KH VPS User

    Nope, it [the cron] didn't work at all, same as you. All of the sudden, it just started working. I have no clue what happened.

Share This Page