I've experienced an issue where some of my scripts run perfectly fine when I call them manually, but these same scripts when called as cron jobs via cron don't seem to work at all.So my question: I'd like to know if there are restrictions that apply with the use of commands and/or scripts (and the privilege of execution) in a script scheduled to run with cron?
Does cron impose some limitations to types of commands and privilege of execution?
command line;cron;bash script
The most common reason why commands that work fine from the command line would fail under cron is the fact they run under a stripped down environment with only a handful of variables defined.In particular PATH is set to its default value.Any customization done in dot files (.profile /etc/profile and the likes) is not done with cron scripts but of course, this can be fixed by modifiying the cron entry or the called script itself.The fact the script is non interactive and missing a graphic environment (DISPLAY variable) might also affect scripts to run as expected. 