Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- set NetworkFolder=\192.168.1.1backups
- set NetworkFolder2="\192.168.1.1backupsbackup_2018-03-23"
- echo.
- for /f %%a in ('sqlcmd -S %SqlServer% -U %Username% -P %Password% -Q "SET NOCOUNT ON select ltrim(convert(date, getdate()))" -h -1') do set CurrentDate=%%a
- echo.
- echo.
- set NetworkFolder2="%NetworkFolder%backup_%CurrentDate%"
- echo.
- IF exist %NetworkFolder2%( xcopy "%LocalFolder%*.*" "%NetworkFolder%backup_%CurrentDate%_Latest" /s/h/e/k/f/c && echo %NetworkFolder_% exists ) ELSE ( xcopy "%LocalFolder%*.*" "%NetworkFolder%backup_%CurrentDate%" /s/h/e/k/f/c && echo %NetworkFolder_% dont exists)
Add Comment
Please, Sign In to add comment