Skip to content

Instantly share code, notes, and snippets.

@bsa7
Last active August 29, 2015 14:18
Show Gist options
  • Save bsa7/2b7212c32a1f09eb8777 to your computer and use it in GitHub Desktop.
Save bsa7/2b7212c32a1f09eb8777 to your computer and use it in GitHub Desktop.
Native Windows Server Rotary Archivation
robocopy c:\ЂаеЁўл\ \\Buh\Ўге аеЁўл\ /E /XC /XN /XO
NET USE V: \\Buh\Ўге аеЁўл
forfiles /P V:\ /S /M *.7z /D -15 /C "cmd /c del @PATH"
NET USE V: /DELETE /YES
robocopy c:\ЂаеЁўл\ \\User1\ аеЁўл\ /E /XC /XN /XO
NET USE V: \\User1\ аеЁўл
forfiles /P V:\ /S /M *.7z /D -15 /C "cmd /c del @PATH"
NET USE V: /DELETE /YES
@echo %date%
set hour=%time:~0,2%
if "%hour:~0,1%" == " " set hour=0%hour:~1,1%
set min=%time:~3,2%
if "%min:~0,1%" == " " set min=0%min:~1,1%
set secs=%time:~6,2%
if "%secs:~0,1%" == " " set secs=0%secs:~1,1%
set year=%date:~-4%
set month=%date:~3,2%
if "%month:~0,1%" == " " set month=0%month:~1,1%
set day=%date:~0,2%
if "%day:~0,1%" == " " set day=0%day:~1,1%
set datetime=%year%%month%%day%_%hour%%min%%secs%
@echo ******************************************************
@echo * Њ бЄ  ­®ў®Ј®  аеЁў : %datetime%
@echo *
@echo ******************************************************
robocopy c:\base1c c:\base1c-%datetime% /E /XF *.lck *.log *.cfl *.bin *.dat *.ind *.lgp *.lgf
c:\progra~1\7-Zip\7z.exe a c:\ЂаеЁўл\server1C-%datetime%.7z c:\base1c-%datetime%
rmdir /S /Q c:\base1c-%datetime%
forfiles /P c:\ЂаеЁўл\ /S /M *.sql /D -15 /C "cmd /c del @PATH"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment