I’ve often written scripts only to discover once added to crontab that it relies on an environment setting such as having the java command in the PATH or having CVSROOT set. To avoid this I now run scripts I’m developing for cron with

env -i

to simulate the script running without an environment as follows:

env -i somescript.sh

This has greatly increased my success rate of adding a script to cron and having it work from the get go.