Forums

Separation of Environment Variables in consoles, SSH, scheduled tasks

I currently have a few web apps running from the same account (and same Postgres server), and wanted to clarify how env. variables would work in the case of deployments / scheduled tasks / ad-hoc scripts. For example:

  • consoles on PA - each new console has it's own env, so as long as I open one console for each web app, and their variables wouldn't "creep" into the other console
  • SSH - I'm using fabric to deploy - each time I run a deployment script, conceptually it'll be like consoles? i.e. each run will effectively create a new environment from scratch
  • Scheduled Tasks - each task running can also be considered as having a new console being set up?

Just wanted to clear my worries, as I'm intending to host more web apps on the same account (and Postgres server) soon - thanks for your patience!

If you set your environment in .bashrc or .profile, the environment will be shared between consoles, ssh and scheduled tasks (but not web apps).

If you set the environment in some other way then each console, ssh session or scheduled task will have the environment that you apply to it.