Sign up ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

1 Answer 1

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.