The default .bashrc files on UBuntu 16.04 (and many other versions) have a built in mechanism to not do anything if they are not an interactive shell.
This can prevent the file from being sourced correctly inside a script that is run by cron! To prevent this, comment out the following lines from the top of your .bashrc file:
Ubuntu 16.04
# If not running interactively, don't do anythingcase $- in *i*) ;; *) return;;esacUbuntu 12.04 and some other versions
# If not running interactively, don't do anything[ -z "$PS1" ] && returnSo long as these are left in if cron runs a script which sources your .bashrc file you won't actually get any of the environment variables you are used to inside your terminal!