Skip to main content
improved formatting
Source Link
Kamil Maciorowski
  • 79k
  • 23
  • 158
  • 242

Keep in mind that a script running in cron does not have the same environment as a script running in shell.

The cron daemon starts a subshell from your HOME directory.

The cron daemon supplies a default environment for every shell, defining HOMEHOME, LOGNAMELOGNAME, SHELLSHELL (=/usr/bin/sh/usr/bin/sh), and PATH and PATH (=/usr/bin/usr/bin).

Do not depend on environment variables. This includes path setting, x11 settings, or anything else.

Use full path, for example:

instead of symplysimply calling javajava or pythonpython you have to use /usr/bin/java/usr/bin/java or /usr/bin/python/usr/bin/python.

Keep in mind that a script running in cron does not have the same environment as a script running in shell.

The cron daemon starts a subshell from your HOME directory.

The cron daemon supplies a default environment for every shell, defining HOME, LOGNAME, SHELL (=/usr/bin/sh), and PATH (=/usr/bin).

Do not depend on environment variables. This includes path setting, x11 settings, or anything else.

Use full path, for example:

instead of symply calling java or python you have to use /usr/bin/java or /usr/bin/python.

Keep in mind that a script running in cron does not have the same environment as a script running in shell.

The cron daemon starts a subshell from your HOME directory.

The cron daemon supplies a default environment for every shell, defining HOME, LOGNAME, SHELL (=/usr/bin/sh) and PATH (=/usr/bin).

Do not depend on environment variables. This includes path setting, x11 settings, or anything else.

Use full path, for example:

instead of simply calling java or python you have to use /usr/bin/java or /usr/bin/python.

added 49 characters in body
Source Link
jcbermu
  • 17.7k
  • 2
  • 54
  • 61

Keep in mind that a script running in cron does not have the same environment as a script running in shell.

The cron daemon starts a subshell from your HOME directory.

The cron daemon supplies a default environment for every shell, defining HOME, LOGNAME, SHELL (=/usr/bin/sh), and PATH (=/usr/bin).

If your shell invokes executables you have to put theDo not depend on environment variables. This includes path setting, x11 settings, or anything else.

Use full path, for example:

instead of symply calling java or python you have to use /usr/bin/java or /usr/bin/python.

Keep in mind that a script running in cron does not have the same environment as a script running in shell.

The cron daemon starts a subshell from your HOME directory.

The cron daemon supplies a default environment for every shell, defining HOME, LOGNAME, SHELL (=/usr/bin/sh), and PATH (=/usr/bin).

If your shell invokes executables you have to put the full path, for example:

instead of symply calling java or python you have to use /usr/bin/java or /usr/bin/python.

Keep in mind that a script running in cron does not have the same environment as a script running in shell.

The cron daemon starts a subshell from your HOME directory.

The cron daemon supplies a default environment for every shell, defining HOME, LOGNAME, SHELL (=/usr/bin/sh), and PATH (=/usr/bin).

Do not depend on environment variables. This includes path setting, x11 settings, or anything else.

Use full path, for example:

instead of symply calling java or python you have to use /usr/bin/java or /usr/bin/python.

Source Link
jcbermu
  • 17.7k
  • 2
  • 54
  • 61

Keep in mind that a script running in cron does not have the same environment as a script running in shell.

The cron daemon starts a subshell from your HOME directory.

The cron daemon supplies a default environment for every shell, defining HOME, LOGNAME, SHELL (=/usr/bin/sh), and PATH (=/usr/bin).

If your shell invokes executables you have to put the full path, for example:

instead of symply calling java or python you have to use /usr/bin/java or /usr/bin/python.