Crontab is specifically built for this - so absolutely use it.
I have cron tasks that occasionally take longer than their period. To combat this I create a lock file when the task starts, and delete it when it ends. If the file already exists when the task starts, then a previous iteration is still running, and the task just ends.
Well, back in the day when I had to use shared hosts w/o access to crontab but with PHP CLI access, I'd built a program with infinitive loop which will tick on a given time period and execute something.
But of course - crontab is the way to go unless you have some crazy heavy operation to carry - in this case 30 secs might overlap and kill your DB eventually as others here already pointed out.