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.

Leave comment

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