上传SVN_李四.bat

参考:https://www.yiibai.com/batch_script/batch_script_date_time.html

参考:http://www.hzhcontrols.com/new-562634.html

参考:https://qastack.cn/programming/13314433/batch-file-to-copy-directories-recursively

参考:https://zhuanlan.zhihu.com/p/75760333

参考:http://www.taodudu.cc/news/show-691550.html?action=onClick

上传SVN_李四.bat

:::::::::::::::::::::::::::::::::::::::::
@set who_name=lisi
@set who_name_zh=李四
:::::::::::::::::::::::::::::::::::::::::
:: 请将\\172.18.6.6\public\OAM\ 映射到Z:盘
@set src_dir=Z:\%who_name%\

:: svn仓库在本地路径
@set dir_who=D:\svn\OAM\%who_name%

:: svn.exe所在目录
@set SVN_CMD_HOME=D:\soft\svnclient\Apache-Subversion-1.14.2-2\bin
:::::::::::::::::::::::::::::::::::::::::

@set year=%date:~0,4%
@set month=%date:~5,2%
@set day=%date:~8,2%
@set hour=%time:~0,2%
@set minute=%time:~3,2%
@set second=%time:~6,2%

@if %hour% LSS 10 (
    @set hour=0%time:~1,1%
)

::@echo %date%
::@echo %time%
::@echo %year%_%month%_%day%_%hour%%minute%%second%

@set dst_dir=%dir_who%\%year%\%month%月\%day%日\%hour%%minute%%second%

:: 创建多级目录
md "%dst_dir%"

:: 拷贝树
robocopy %src_dir%  "%dst_dir%" /e

@set path=%path%;%SVN_CMD_HOME%

echo "######################################################"
cd %dir_who%
set SVN_EDITOR=notepad
svn add * --force
svn commit
:: svn commit -m "for %who_name_zh%:"
echo "######################################################"

pause

 

posted @ 2023-06-17 16:07  LiuYanYGZ  阅读(13)  评论(0编辑  收藏  举报