Quantcast
Viewing latest article 2
Browse Latest Browse All 4

Answer by robcast for OS X cron and environment variables

I haven't checked in detail but the bash manpage explains (search for INVOCATION) that bash doesn't read /etc/profile when it's not invoked as a login or interactive shell.

The login program always launches the shell as a login shell so I guess cron does not and the shell doesn't read any profile files (according to the man page it would read the file given in the ENV variable when the shell was started but cron doesn't seem to have an option to set that).

I found it generally to be problematic to rely on any global settings (e.g. PATH) in cron job scripts so I define my own settings in every script.


Viewing latest article 2
Browse Latest Browse All 4

Trending Articles