I'm using a shared server on Hostgator (Linux CentOS). I'm trying to set a cron job using the Control Panel that will check if its already running before starting a new one.
Traditional way is to have the script create a file somewhere containing the process' PID, and check if the file's present and the PID's valid to see if it's still running. The start-stop-daemon utility can help simplify this.
Your way may work if you're only ever running one instance at a time, ever. You've got some extra [ ] there. Try this:
Most of the time this cron command works, but every so often, it fails. How could I change the command so that when the command gets an error, it simply does NOT execute the php script?