title: crontab PATH and USER
body: <p>I am new to scheduling tasks with cron and crontab.  I am trying to schedule execution of a task as if I had logged on, opened a terminal, and executed it myself.</p>
  
  <p>However, I scheduled a task to help me observe what $USER and $PATH a scheduled task is executing with, and this is what I found:</p>
  
  <pre><code>$ crontab -l
  41 11 * * * echo "USER: $USER" &gt; ~/Desktop/cron_env.log; echo "PATH: $PATH" &gt;&gt; ~/Desktop/cron_env.log
  $ cat ~/Desktop/cron_env.log
  USER:
  PATH: /usr/bin:/bin
  </code></pre>
  
  <p>It appears as though $USER is not set, and $PATH is something very basic and/or default.  On the contrary, this is what I see when I open a terminal (logged in) and echo this same information:</p>
  
  <pre><code>USER: aschirma
  PATH: /usr/lib/jvm/java-6-sun/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/pkg/icetools/bin:/pkg/hwtools/bin:/pkg/netscape/bin:/pkg/gnu/bin
  </code></pre>
  
  <p>What do I need to do to make my crontab tasks run the way I want?</p>