Last active
August 29, 2015 14:18
-
-
Save bsa7/2b7212c32a1f09eb8777 to your computer and use it in GitHub Desktop.
Native Windows Server Rotary Archivation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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