Skip to content

Instantly share code, notes, and snippets.

@jeromyanglim
Created November 4, 2017 04:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jeromyanglim/79d3f2202df232cd7e82c2947fe0d62f to your computer and use it in GitHub Desktop.
Save jeromyanglim/79d3f2202df232cd7e82c2947fe0d62f to your computer and use it in GitHub Desktop.
example of a makefile that runs an r job and sends an email when done.
EMAIL=youremail@gmail.com
SERVER=username@yourserver.com
mode=standard # e.g., quick, standard, publication
all:
make models mode=$(mode)
make ppc mode=$(mode)
make standard-figures mode=$(mode)
make yhat mode=$(mode)
models:
Rscript -e "library(knitr); analysis_mode = '$(mode)'; knit('reports/bayesian-models.rmd')"
echo "Models on $(mode) is complete." | mail -s "Models on $(mode) is complete." $(EMAIL)
ppc:
Rscript -e "library(knitr); analysis_mode = '$(mode)'; knit('reports/bayesian-ppc.rmd')"
echo "ppc on $(mode) is complete." | mail -s "ppc on $(mode) is complete." $(EMAIL)
figures:
Rscript -e "library(knitr); analysis_mode = '$(mode)'; knit('reports/bayesian-figures.rmd')"
echo "standard-figures on $(mode) is complete." | mail -s "standard-figures on $(mode) is complete." $(EMAIL)
yhat:
Rscript -e "library(knitr); analysis_mode = '$(mode)'; knit('reports/mu_y.rmd')"
echo "yhat on $(mode) is complete." | mail -s "yhat on $(mode) is complete." $(EMAIL)
updatelocal:
rsync -av --update $(SERVER):~/dynamic-pwi-analysis/ .
updateserver:
rsync -av --update . $(SERVER):~/dynamic-pwi-analysis/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment