7zGoPath.bat
@echo offpushd "%~dp0":configfor /f "delims=" %%t in ('powershell /command "Get-Date -Format 'yyyy-MM-dd-HH-mm-ss'"') do set datetime=%%tset output="%USERPROFILE%\Desktop\gopath_%datetime%_src.7z"set input="%GOPATH%\src"set xr=-xr!yourpath\set cmd="%PROGRAMFILES%\7-zip\7z.exe":exec%cmd% a -mx=9 %output% %input% %xr%echo Press any key to EXIT...pause>nul:endpopd
mac:
$ 7za a -mx=9 ~/Desktop/gopath_`date +%Y-%m-%d-%H-%M-%S`_src.7z $GOPATH/src -xr\!yourpath/
-xr用于排除不需要备份的路径。