jump to navigation

Adding environment variables to cron via whenever November 24, 2009

Posted by John Dewey in Crontab, Plugins & Gems.

I wanted my users’ cron to run under zsh, so it picks up the .zshenv — which contains additional environment variables, my rake task required.

Can add the following to schedule.rb. This will work with any ENVIRONMENT=variable.

### schedule.rb
env ‘SHELL’, ‘/usr/bin/zsh’


1. Chris Blackburn - February 9, 2011

Thanks John, couldn’t find this anywhere else.

2. Andrey - October 16, 2015

thanks a lot, it really helped me

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: