cron context
Also, remember that cron doesn't run in your context even if it is your own personal crontab running. This means you need to be explicit about everything!
For instance, are you writing to a file? Cron doesn't know what directory you are in, cause it runs all alone! You need to specify a full (absolute) path in your cron command or in the script that in launches.
Bad:
echo "hey, I just ran" >> my-script-log
Good:
echo "hey, I just ran" >> /home/myuser/logs/my-script-log
Info: I have found that if you don't specify an absolute path, cron assumes you are in your home directory, and will execute commands there, sometimes even if your script lives elsewhere (!) If you want actions to take place the same dir as your script, make your script specify the current dir by using ./myfile rather than myfile.
Likewise, are you launching a program? Cron may run with a different path than you, so specify the full path.
Finally, stuff that interacts with your visual and audio output won't go where you expect it to because cron is running in the background and not in your context. Witness the example of the zenity command that pops up a notification box.
Works when you type it but not when cron runs it:
zenity --info --text "hey, I just ran"
Tell zenity which display to send the popup to (cron doesn't know!):
DISPLAY=:0.0 /usr/bin/zenity --info --text "hey, I just ran"
Info:You can find which display you are using by running:
echo $DISPLAY