Last active
December 11, 2015 05:58
-
-
Save kebot/4556059 to your computer and use it in GitHub Desktop.
Make file for rsync, it's a simple dropbox
This file contains hidden or 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
# | |
# Makefile for rsync | |
# | |
# [help with rsync](http://bbs.chinaunix.net/thread-2116588-1-1.html) | |
RSYNC_SERVER = <username>@<server>:~/Cloud | |
LOCAL_FOLDER = ~/Cloud | |
PARAM = -avz --delete --exclude-from=.rsyncignore | |
# the safest rsync, did not delete anything | |
# rsync src dst | |
rsync: | |
@echo 'run make push or pull' | |
push: | |
@echo "Push will delete files doesn't exists in local" | |
rsync $(PARAM) $(LOCAL_FOLDER) $(RSYNC_SERVER)/../ | |
# pull from the remote server, also delete | |
pull: | |
@echo "Push will delete files doesn't exists in remote server" | |
rsync $(PARAM) $(RSYNC_SERVER) $(LOCAL_FOLDER)/../ | |
.PHONY: rsync push pull |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment