Commit 3aa234a

mo khan <mo@mokhan.ca>
2015-12-24 20:22:53
fix s3 backup.
1 parent 4b1e3e6
recipes/postgres.rb
@@ -63,6 +63,8 @@ end
 
 aws_config = node['stronglifters']['aws']['profiles']['default']
 
+package "python-pip"
+execute "pip install awscli"
 cron 'pg_backups' do
   action :create
   command "#{backups_dir}/pg_backup_rotated.sh -c /etc/postgresql/pg_backup.config"
templates/pg_backup.config.erb
@@ -2,7 +2,7 @@ BACKUP_USER=
 HOSTNAME="localhost"
 USERNAME="postgres"
 BACKUP_DIR=<%= @backup_dir %>
-S3_PATH=<%= @s3_path %>
+S3_PATH=<%= @s3_backup_path %>
 SCHEMA_ONLY_LIST=""
 ENABLE_CUSTOM_BACKUPS=yes
 ENABLE_PLAIN_BACKUPS=yes
templates/pg_backup_rotated.sh.erb
@@ -134,4 +134,4 @@ perform_backups "-daily"
 
 [ -z "$S3_PATH" ] && echo "no aws backup" && exit 0;
 
-aws s3 sync $BACKUP_DIR $S3_PATH
+/usr/local/bin/aws s3 sync $BACKUP_DIR $S3_PATH