DreamHost Error: Please Do Not Make Multiple Jobs For The Same Command

Error when creating cron jobs in DreamHost’s Web Panel.

Trying to create some cron jobs but getting the error: Please do not make multiple jobs for the same command?
The DreamHost Web Panel is telling you exactly what the error is, but didn’t you wish it also gave you a workaround?
Firstly let’s understand the error: you already have another cron job running the exact same program, so you can’t set the second one because of this error.

Let’s imagine that the command lines you are planning to run periodically are:
/usr/bin/php -q /home/[CpanelUsername]/cronjobs/script1.php
/usr/bin/php -q /home/[CpanelUsername]/cronjobs/script2.php
Obviously the second cron job will run the same command: /usr/bin/php but with a different argument. The DreamHost Web Panel does not care and will not let you add the second cron job.

The solution is simple: create an sh script that runs both php commands and set the cron job to run that sh script:
sh /home/[CpanelUsername]/cronjobs/myscript.sh

The contents of the shell script will be:
#!/bin/sh
/usr/bin/php -q /home/[CpanelUsername]/cronjobs/script1.php
/usr/bin/php -q /home/[CpanelUsername]/cronjobs/script2.php

Off topic notice: This error does not make DreamHost any lower, we just want to offer you an easy workaround.

Dreamhost is among our favorite web hosting providers. It is probably in the top 5 among Bluehost,  JustHost, InMotion Hosting and HostGator, but as you probably know ConnicTech loves HostGator.

1 Comment

  1. Norman Love -  2018/11/22 - 3:48 PM

    This does not address the idea that some cron jobs are time sensitive and have to be run at various times. The major thing with crons is that they allow commands to be run at a set time. Running all the commands at the same time, as above, is not what my situation needs.

Leave comment

Your email address will not be published. Required fields are marked *