K
K
KOVIS2015-04-01 13:44:16
cmd/bat
KOVIS, 2015-04-01 13:44:16

How to properly configure XCOPY in MS SQL to copy files for the current day?

I add a job step CmdExec
XCOPY /D:%Date:~3.2%-%Date:~0.2%-%Date:~6.4% J:\FULL\*.bak B:\*.* /Y /E /C /H /R
does not understand %Date:~3.2%-%Date:~0.2%-%Date, unlike cmd which recognizes it without problems.
XCOPY /DJ:\FULL\*.bak B:\*.* /Y /E /C /H /R - works but does not suit that it copies all files from the folder, only the file for today is needed.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Saboteur, 2015-04-01
@KOVIS

You can use https://github.com/sfkulyk/curtime32/blob/master/c... ( https://github.com/sfkulyk/curtime32 )
curtime32 "XCOPY /D:$d-$M-$y J :\FULL\*.bak B:\*.* /Y /E /C /H /R" /exec

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question