I am trying to learn how to set up a custom cron job in my user’s crontab using the Shell to run a PHP script:
[php]*/5 * * * * flock -n /tmp/scriptname sh -c $’/usr/local/php70/bin/php /path-to-my-script/script.php’[/php]
It seems to run properly. My problem: When I use the unix “top” command to see a list of all running processes for the user, this cronjob shows up vaguely on two lines as Command: “php” and “flock”. Whereas if I set this up on Dreamhost’s Admin Panel, it should show up more informatively as: “/usr/local/php70/bin/php /path-to-my-script/script.php” so I can see exactly what cronjob is running
How do I do this so it shows up informatively like this so I can see exactly which cronjobs processes are currently running? Is there a tag I’m supposed to add to each command in the crontab?
EDIT: I noticed Dreamhost uses “/usr/local/bin/setlock” instead of “flock”. Is “setlock” a custom-built dreamhost command? Any advantages of using “setlock” instead of “flock”?
Also, I just watched some of the old cronjobs I set up through Dreamhost Admin Panel and noticed it’s no longer showing the informative command. I recently had my server upgraded to Ubuntu 12.04 LTS, maybe this is the reason? I haven’t noticed this change until just now.