Skip to content

Instantly share code, notes, and snippets.

@bru
Last active August 24, 2016 20:48
Show Gist options
  • Save bru/2763fd3327d6608340c4103c542cddfd to your computer and use it in GitHub Desktop.
Save bru/2763fd3327d6608340c4103c542cddfd to your computer and use it in GitHub Desktop.
Elastic Beanstalk extension to run a cron job
files:
"/tmp/cronjob" :
mode: "000777"
owner: webapp
group: webapp
content: |
# retrieve assets
* * * * * bash -l -c "/usr/local/bin/wp --allow-root --path='/var/app/current/blog1/' eval 'fetch_external();'" >> /var/log/httpd/wp-cli.log 2>&1
* * * * * bash -l -c "/usr/local/bin/wp --allow-root --path='/var/app/current/blog2/' eval 'fetch_external();'" >> /var/log/httpd/wp-cli.log 2>&1 encoding: plain
commands:
setup_jobs:
command: crontab /tmp/cronjob
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment