Last active
April 19, 2016 06:34
-
-
Save takp/2b825ce3bd155beb2ccf133aaf532af4 to your computer and use it in GitHub Desktop.
AWS ElasticBeanstalk + RailsでCronを設定する ref: http://qiita.com/tak_nishida/items/912fda099e54b0292667
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SHELL=/bin/bash | |
PATH=/sbin:/bin:/usr/sbin:/usr/bin | |
MAILTO=root | |
HOME=/ | |
0 20 * * * root /var/script/sitemap.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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