Last active
July 9, 2019 14:57
-
-
Save adamcstephens/59ea021a790af8941985cc771b8fedf5 to your computer and use it in GitHub Desktop.
backup files with make
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
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