Question : Assistance with DOS script

Our MS-SQL backups are moved from one server to another via a bat file.

Script


echo on

rem Script to move daily database backups to Destination Server/SQLBACKUP%
rem Destination server is mapped, files are moved then the Destination server is unmapped
rem FOR server SQL1

NET USE Y: "\\destination\SQLBACKUP$"

MOVE /Y C:\SQLBAC~1\Data\*.* Y:\SQL1\Data

NET USE Y: /DELETE


The problem is that the current DOS code moves over everything and the date modified equals all backups on the destination server.

Need the DOS script to either bring over that days timestamp file (which is like db20080225.bak) or look at the modified file and bring over the current day's modified file

Answer : Assistance with DOS script

You can play around with the numbers here to see how this syntax works:

@echo %date%
@echo %date:~4,2%
@echo %date:~7,2%
@echo %date:~10,4%
Random Solutions  
 
programming4us programming4us