You are not logged in.
I am trying to create a log file each day but the process errors out. Here is the short copy of the file.
@echo on
for /f "tokens=2-4 delims=/ " %%a in ('date /T') do set year=%%c
for /f "tokens=2-4 delims=/ " %%a in ('date /T') do set month=%%a
for /f "tokens=2-4 delims=/ " %%a in ('date /T') do set day=%%b
REM ** Year= %year% Month= %month% Day= %day% **
Timeout 20
mkdir c:\delete
dir c:\delete
Timeout 20
c:\windows\system32\robocopy.exe "C:\microsoft sql server" "c:\Delete" /e /MOV /MINAGE:2 /LOG:C:\%month%-%day%.log\
timeout 35
dir c:\delete
timeout 35
rmdir c:\delete /s /q
dir C:\microsoft sql server
Can anyone tell me what I am doing wrong?
Offline
Writing a log file to the root of the C: drive is verboten, try putting it into C:\Logs\%month%-%day%.log
Offline
I revised the location of the logs but it still comes up with the following error:
ERROR : Invalid parameter #6 : "/Logs\05-21.log"
Offline
I created the C:\logs directory and modified the command line to be as follows:
c:\windows\system32\robocopy.exe "C:\microsoft sql server" "c:\Delete" /e /MOV /MINAGE:2 /LOG:"C:\Logs\robocopy-%month%_%day%.log"
It will work now.
Offline