Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'd like to make sure that every user specific crontab has the same PATH-environment. I tried to set the PATH in /etc/crontab but it seems like this config file is not read by crond.

Following are the cron related packages that are installed on my machine:

root@machine:~> rpm -qa | grep cron

UPDATE: my /etc/crontab

sorry for the late reply.


# For details see man 4 crontabs

# Example of job definition:
# .---------------- minute (0 - 59)
# |  .------------- hour (0 - 23)
# |  |  .---------- day of month (1 - 31)
# |  |  |  .------- month (1 - 12) OR jan,feb,mar,apr ...
# |  |  |  |  .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
# |  |  |  |  |
# *  *  *  *  * user-name command to be executed
share|improve this question
Christian, please merge your accounts by following the procedure here – you need to log in with your old credentials to be able to edit the question, add comments, etc. Thanks. – slhck Jul 12 '13 at 8:56

Are you sure you are setting the $PATH correctly? Have a look at man 5 crontab:

An  active  line in a crontab will be either an environment setting or a cron com‐
mand.  The crontab file is parsed from top to bottom, so any environment  settings
will affect only the cron commands below them in the file.  An environment setting
is of the form,

    name = value

where the spaces around the equal-sign (=) are optional, and any  subsequent  non-
leading  spaces  in  value  will be part of the value assigned to name.  The value
string may be placed in quotes (single or double, but matching) to preserve  lead‐
ing  or  trailing  blanks.  To  define an empty variable, quotes must be used. The
value string is not parsed for environmental substitutions or replacement of vari‐
ables, thus lines like

    PATH = $HOME/bin:$PATH

will not work as you might expect. And neither will this work

    C=$A $B
There will not be any subsitution for the defined variables in the last value.

An alternative for setting up the commands path is using the fact that many shells
will treat the tilde(~) as substitution of $HOME, so if  you  use  bash  for  your
tasks you can use this:

share|improve this answer
Hi terdon, thanks for your reply. There are no variables in my PATH definition. I already tried to put the string in quotes, but it's not working either. – christian Jun 25 '13 at 6:19
@christian strange. Could you post the /etc/crontab that is ignored? – terdon Jun 25 '13 at 12:57
@christian never post updates as comments, they are impossible to read and get lost in the clutter. Edit your original question instead. – terdon Jul 1 '13 at 14:27
Any further tips for this issue? You can see the ignored crontab in my initial post as an update. – christian Jul 12 '13 at 14:16
@christian /etc/crontab is not a configuration file, it is the system-wide crontab. So any settings set there will not be inherited by the user specific crontabs. Not a bug but a feature in other words. Sorry, I don't know how to set a system wide cronpath other than setting a system wide path. – terdon Jul 12 '13 at 14:33

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .