Skip to content

Instantly share code, notes, and snippets.

@adamcstephens
Last active July 9, 2019 14:57
Show Gist options
  • Save adamcstephens/59ea021a790af8941985cc771b8fedf5 to your computer and use it in GitHub Desktop.
Save adamcstephens/59ea021a790af8941985cc771b8fedf5 to your computer and use it in GitHub Desktop.
backup files with make
files_dir := ./files
files = $(wildcard $(files_dir)/.[a-z]*)
all:
rsync -av $(files_dir)/ ${HOME}/
backup:
$(foreach file, $(files), rsync -av --delete ${HOME}/$(shell echo $(file) | sed "s/\.\/files\///") $(files_dir)/;)
.PHONY: all backup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment