Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Cron scripts are executed in "limited" environment, PATH and co are very restrained.

How can I emulate this env setting from interactive shell so that I could debug scripts that work great from user shell bug fail on the cron shell

share|improve this question

I found this nice post on SO. One of the answers suggest to get the environment variables using env and directing the output to a text file in a cron job. Then, you can "import" the same variables in your current shell.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.