Skip to content

Instantly share code, notes, and snippets.

@takp
Last active April 19, 2016 06:34
Show Gist options
  • Save takp/2b825ce3bd155beb2ccf133aaf532af4 to your computer and use it in GitHub Desktop.
Save takp/2b825ce3bd155beb2ccf133aaf532af4 to your computer and use it in GitHub Desktop.
AWS ElasticBeanstalk + RailsでCronを設定する ref: http://qiita.com/tak_nishida/items/912fda099e54b0292667
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/
0 20 * * * root /var/script/sitemap.sh
#!/usr/bin/env bash
set -xe
EB_SCRIPT_DIR=$(/opt/elasticbeanstalk/bin/get-config container -k script_dir)
EB_SUPPORT_DIR=$(/opt/elasticbeanstalk/bin/get-config container -k support_dir)
EB_DEPLOY_DIR=$(/opt/elasticbeanstalk/bin/get-config container -k app_deploy_dir)
. $EB_SUPPORT_DIR/envvars
. $EB_SCRIPT_DIR/use-app-ruby.sh
cd /var/app/current
RAILS_ENV=production bundle exec rake sitemap:refresh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment