title: Adb path not found while running cron
body: <p>I am trying to run some adb commands using cron. While running cron, I expect it to run under a default shell environment and not the user's which is why I provide the path of adb file to be appended in the PATH while setting up cron as follows. However as you can see from the output, cron fails to find adb. </p>
  
  <p><strong>Command I use to set crontab</strong></p>
  
  <pre><code>sudo crontab -u mcj -e
  </code></pre>
  
  <p>Crontab</p>
  
  <p><strong>cron_script.sh</strong></p>
  
  <pre><code>#!/usr/bin/env bash
  
  export PATH=$PATH:/usr/local/bin/adb
  export PATH=$PATH:/Users/mcj/bin/darwin/adb
  adb_path="$(which adb)"
  echo "adb path: "$adb_path
  echo "path: "$PATH
  echo "home: "$HOME
  </code></pre>
  
  <p><strong>Output</strong></p>
  
  <pre><code>adb path: 
  path: /usr/bin:/bin:/usr/local/bin/adb:/Users/mcj/bin/darwin/adb
  home: /Users/mcj
  </code></pre>
  
  <p>If I use a terminal and try to run which adb as follows, it does find the adb path</p>
  
  <pre><code>Milin'sMacBook:~ mcj$ which adb
  /usr/local/bin/adb
  </code></pre>