Jenkins-在windows上配置自动化部署(Jenkins+Gitlab+IIS)
Jenkins-在windows上配置自动化部署(Jenkins+Gitlab+IIS)
web部署样例
windows服务部署样例
系统备份
在服务器上创建后缀名为.ps1的文件,例:BackUpDir_MKCurtain.ps1
内容参考:
param($pathFrom,$pathTo) #目标目录 $pathTo = $pathTo+"\bak"+(Get-Date -Format 'yyyyMMddHHmmss'); write-host("SourcePath is: " + $pathFrom); write-host("TargetPath is: " + $pathTo); #创建目标目录 mkdir -Pa $pathTo; if (!(Test-path -path $pathFrom)){ write-host("SourcePath is not exist!"); exit -1; } $pathCopyTo = ""; $pathFromLen = $pathFrom.Length; $LenGap = 0; ls -r $pathFrom |Foreach-Object{ if(!($_.FullName -match ".*\\log")) { if(!($_.FullName -match ".*\\jpg")) { $lenGap = $_.FullName.Length - $pathFromLen - $_.Name.Length - 1; $pathCopyTo = $PathTo + $_.FullName.Substring($pathFromLen, $lenGap); if(!(Test-path -path $pathCopyTo)){ mkdir -Pa $pathCopyTo; } copy-item $_.FullName $pathCopyTo -Force; } } } write-host("Copy Finish!"); exit 0;