diff --git a/test/makefile b/test/makefile index 9bb9c4c..9c6d1a7 100644 --- a/test/makefile +++ b/test/makefile @@ -1,6 +1,21 @@ SHELL=/usr/bin/env bash date_dir_name = $(shell date +"%Y%m%d-%H%M%S") +dir_file_path=/disk +backups_dir_path=/disk/web/backups +version=0.0.1 +server_dir_path=/var/www/web/ test: @echo $(date_dir_name) + @echo $(dir_file) - \ No newline at end of file + +public: + # make public version=0.0.1 dir_file_path=/ + #make var dir_file_path=aaa + @echo $(date_dir_name) + # 创建备份文件夹 + mkdir -p $(backups_dir_path)/$(version)/$(date_dir_name) + # 从服务器同步到本地,备份 + rsync -avz ubuntu@101.43.19.200:$(server_dir_path) $(backups_dir_path)/$(version)/$(date_dir_name) + # 从本地同步到服务器 + rsync -avz $(dir_file_path) ubuntu@101.43.19.200:$(server_dir_path)