2

A given crontab entry gives errors and the reason is that it can not read all env variables from bash. I wonder how could I pass all this info to cron

Open the way
  • 26,225
  • 51
  • 142
  • 196
  • 2
    To the "off-topic" closer: I'll think you'll find that both (1) `bash` is a programming language as well as a user shell; and (2) `cron` is a tool commonly used by programmers. – paxdiablo Jun 20 '11 at 04:09

1 Answers1

3

One trick I've used in the past is to open up a bash session for the specific user and just type:

env >$HOME/.cronenv

You can this source this file from your cron scripts (or directly from the crontabs if you're running an executable you can't change) with something like:

. $HOME/.cronenv

This is, of course, using a thermonuclear warhead to kill a fly. You should really identify the bare minimum that your script requires and just use that.

paxdiablo
  • 854,327
  • 234
  • 1,573
  • 1,953