title: How to run a bash script via Cron
body: <p>I have seen other questions that are similar but I can't find any real information on how to figure out the proper way to run a Bash script via Crontab. The <code>.sh</code> file is located in the user directory (in my case <code>serverpilot</code>). </p>
  
  <p>The script is trying to copy the contents of the <code>apps</code> folder and send to my S3 bucket. The script works perfectly when run with <code>sh backupS3.sh</code> from the terminal but no joy via Cron. I've seen people reference PATH variables and the like but no idea where to even begin!</p>
  
  <p>/backupS3.sh</p>
  
  <pre><code>#!/bin/sh
  echo 'Started backing to S3'
  date +'%a %b %e %H:%M:%S %Z %Y'
  aws s3 sync /apps s3://bucketname
  date +'%a %b %e %H:%M:%S %Z %Y'
  echo 'Finished backing to S3'
  </code></pre>
  
  <p>crontab</p>
  
  <pre><code>*/10 * * * * /backupS3.sh &gt;&gt; backupS3.log  
  </code></pre>
  
  <p>Can anyone point me at anything obvious I'm doing wrong? Thanks! </p>
  
  <p>EDIT: I've added 2>&amp;1 on to the end of the cron command and now I am getting something in the log file:</p>
  
  <p><code>/bin/sh: 1: /backupS3.sh: not found</code></p>