Skip to content

Instantly share code, notes, and snippets.

@jvinceso
Created January 31, 2017 20:51
Show Gist options
  • Save jvinceso/fb620bc2440bf22ac62ca0ea40e59515 to your computer and use it in GitHub Desktop.
Save jvinceso/fb620bc2440bf22ac62ca0ea40e59515 to your computer and use it in GitHub Desktop.
Empaqueta todas las carpetas que encuentre en una ruta dada en archivos .7z individuales
@echo off
REM AUTHOR=Jose Vinces
REM #dsdfsd
set year=%date:~-4,4%
set month=%date:~-10,2%
set day=%date:~-7,2%
set hour=%time:~-11,2%
set hour=%hour: =0%
set min=%time:~-8,2%
set sharedMortifago="\\10.10.21.230\backups\WebS2\"
set rutaOrigen= "D:\Documentos GRLL\Contingencias_Enviadas\"
set oficinaName=oficinadigital.%year%.%month%.%day%.%hour%%min%.7z
set horaArchivoExtension=%year%.%month%.%day%.%hour%%min%.7z
set destinoOficina= "\\10.10.21.230\backups\WebS\%oficinaName%"
REM #Ruta Portal Oficial
echo la ruta Origen %rutaOrigen%
for /R %rutaOrigen%\ /D %%* in (.\*) do (
rem echo %%*
rem set CurrDirName=%%~nx*
rem echo %%~nx*
rem echo %CurrDirName%
rem set CurrDirName=1
7z a -mx9 -r -t7z %sharedMortifago%%%~nx*_%horaArchivoExtension% %rutaOrigen%\%%~nx*\*
)
rem pause
rem set rutaPortal= "D:\SitiosWeb\V2\*"
rem set destinoPortal= %sharedMortifago%PortalV2.%year%.%month%.%day%.%hour%%min%.7z
rem echo la ruta sds "%rutaOrigen%"
rem 7z a -mx9 -r -t7z %destinoOficina% %rutaOrigen%
rem echo Oficina Digital %rutaOrigen% backed up to %destinoOficina% is complete!
rem echo backupeando "%rutaPortal%"
rem 7z a -mx9 -r -t7z %destinoPortal% %rutaPortal%
rem echo Oficina Digital %rutaPortal% backed up to %destinoPortal% is complete!
REM #7z a oficinaName 9 -mx9 -xr!excluir -xr!*.7z -r "D:\d\log\*"
REM #7z a oficinaName 9 -mx9 -xr!excluir -xr!*.7z -r "D:\d\log\*"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment