How do I create a cron job?

You can have DreamHost automatically configure a cron job in the panel under one of your shell users.

To set up a cron in the panel:

  1. Navigate to the (Panel > 'Goodies' > 'Cron Jobs') page.
    The 'Cron Jobs' page appears:
    01 Crontab crontab page.png
  2. Click the Add New Cron Job button
    The 'Creating New Cron Job' page opens:
    950px-02 Crontab simple example.png
  3. To create the cron, fill in the following fields:
    • User: From the dropdown menu choose an existing shell user you'd like the cron job to run under.
    • Title: Give the cron job a name you'll remember.
    • Email output to: Enter an email address you'd like to receive the cron output to. You can also leave this blank to not receive emails.
    • Command to run: Enter the command to run.
    • Use locking: Enabling this if you want to prevent the job from running more than once at a time.
    • When to run: From the dropdown menu, choose how often you'd like this job to execute.

    The command you enter usually must first specify the path to the program you'd like to use to run the cron job. For example let's say you have a PHP file named script.php in your domains directory:

    • /home/username/example.com/script.php

    To run this command you'd enter the path to your chosen version of PHP followed by a space, followed by the path to the file:

    • /usr/local/php56/bin/php /home/username/example.com/script.php

    See also

Did this article answer your questions?

Article last updated .