Hello all,
I have a problem that challenges my (forgotten) batch programming
skills as well as my google skills. I hope you can help me.
The situation:
I have a backup server collecting backups from other servers, then a
batch file is supposed to sort away the latest backup files so that
the server can transfer them to tape medium.
I've managed to do this the following way (taking the latest modified
bkf-file):
for /f "tokens=*" %%a in ('dir /a-d/od/b f:\SERVER_Full_Day_5\*.bkf')
do set newbak=%%a
move f:\SERVER_Full_Day_5\%newbak% f:\SERVER_Full_To_Tape\%newbak%
Now, the backup program is updated - backing up the system state
information into directories. It seems like the latest modified
directory always has the latest modified files, so that's the one I
want to find and move away.
Attempting to rewrite the for statement above using the following or
for
/d, cutting out the tokens part have not worked so far and I'm not
sure
what the next step would be.
for /f "tokens=*" %%b in ('dir /ad/od/b f:\SERVER\Full_Day_5\') do set
newsysstate=%%b
Am I even close to realizing this? Thanks in advance for all help.
Pontus