title: Create cron job on aws ebs to run a python script
body: <p>I have a Elastic BeanStalk server on aws being used as a JSON server.  The data files need to be updated daily.
  I have a python script that I want to run every weekday to update the data files. I created .ebextensions folder and created cronjob.config below. I want to run update_data_files.py daily.
  I used the template for cronjob.config from : <a href="https://aws.amazon.com/premiumsupport/knowledge-center/cron-job-elastic-beanstalk/" rel="nofollow noreferrer">https://aws.amazon.com/premiumsupport/knowledge-center/cron-job-elastic-beanstalk/</a></p>
  
  <p>Question:
  How do I run this script as cronjob?  what is the path to the uploaded folder in ebs so that the python script will run?  </p>
  
  <p>python3 update_data_files.py</p>
  
  <p>.....cronjob.config.....</p>
  
  <pre><code>files:
      "/etc/cron.d/mycron":
          mode: "000644"
          owner: root
          group: root
          content: |
              5 16 * * 1-5 root /usr/local/bin/myscript.sh
      "/usr/local/bin/myscript.sh":
          mode: "000755"
          owner: root
          group: root
          content: |
              #!/bin/bash
              date &gt; /tmp/date
              # Your actual script content
  
              python3 update_data_files.py
  
              exit 0
  commands:
      remove_old_cron:
          command: "rm -f /etc/cron.d/*.bak"
  </code></pre>