title: Interaction between aws cli, crontab and user privileges
body: <p>I have a ec2 that's supposed to sync to s3 every 5mins, so I installed awscli under sudo, entered my credentials in using aws configure. I then created a shell script at /home/ubuntu/ with entries such as:</p>
  
  <pre><code> aws s3 cp s3://datasets/B3 /home/ubuntu/data/B3 --recursive
  </code></pre>
  
  <p>And in the sudo crontab:</p>
  
  <pre><code>*/5 * * * * /home/ubuntu/s3syncer.sh
  </code></pre>
  
  <p>But it doesn't sync. I've had this issue before so I tried:</p>
  
  <pre><code>/home/ubuntu/.aws aws s3 cp s3://datasets/B3 /home/ubuntu/data/B3 --recursive
  /usr/bin/aws aws s3 cp s3://datasets/B3 /home/ubuntu/data/B3 --recursive
  </code></pre>
  
  <p>And it seems /usr/bin/aws is now working....
  Also when I try 'aws configure' as user ubuntu, it says Incorrect permissions.</p>
  
  <ol>
  <li><p>How are permissions for editing aws configure determined? Did installing it with sudo make it so I can't edit configure as ubuntu?</p></li>
  <li><p>How does /usr/bin/aws change the execution of aws s3 syncing?</p></li>
  <li><p>How are commands executed from sudo v ubuntu crontabs different?</p></li>
  </ol>
  
  <p>Thanks, some these are general linux questions...</p>