Crontab does not source .bashrc
search cancel

Crontab does not source .bashrc

book

Article ID: 296530

calendar_today

Updated On:

Products

VMware Tanzu Greenplum VMware Tanzu Greenplum / Gemfire

Issue/Introduction

When running commands/scripts in crontab jobs the Greenplum Environment not set up. Why is this?

Resolution

This issue you are seeing is an OS/utility issue. Crontab does not source the users login environment. The environment will need to be configured by the script being by crontab or :
 

  • Modify the commands your crontab job executes, sourcing .bashrc first, followed by the command:
source ~/.bashrc && <other  script command(s))>
  • Modify all the scripts you are executing through crontab to execute source .bashrc