From 809b281c58b34fe21f4333c62b73c817a66493e0 Mon Sep 17 00:00:00 2001 From: isms Date: Fri, 30 Oct 2015 15:19:25 -0400 Subject: [PATCH] Add Makefile entries for syncing data to S3 --- cookiecutter.json | 1 + {{ cookiecutter.repo_name }}/Makefile | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/cookiecutter.json b/cookiecutter.json index 5d17a58..8903385 100644 --- a/cookiecutter.json +++ b/cookiecutter.json @@ -1,4 +1,5 @@ { "project_name": "project_name", "repo_name": "{{ cookiecutter.project_name|replace(' ', '_') }}", + "s3_bucket": "your-bucket-for-syncing-data" } diff --git a/{{ cookiecutter.repo_name }}/Makefile b/{{ cookiecutter.repo_name }}/Makefile index 2a12e0f..3a0c5f2 100644 --- a/{{ cookiecutter.repo_name }}/Makefile +++ b/{{ cookiecutter.repo_name }}/Makefile @@ -1,7 +1,13 @@ -.PHONY: clean data +.PHONY: clean data sync_data_to_s3 sync_data_from_s3 data: python src/make_dataset.py clean: find . -name "*.pyc" -exec rm {} \; + +sync_data_to_s3: + s3cmd sync --recursive data/ s3://{{ cookiecutter.s3_bucket }}/data/ + +sync_data_from_s3: + s3cmd sync --recursive s3://{{ cookiecutter.s3_bucket }}/data/ data/