Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Computing > Alt Msdos Batch Nt > Finding latest ...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 3 Topic 3289 of 3403
Post > Topic >>

Finding latest modified directory

by Pontus <pontus.laurell@[EMAIL PROTECTED] > Jun 9, 2008 at 04:01 AM

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
 




 3 Posts in Topic:
Finding latest modified directory
Pontus <pontus.laurell  2008-06-09 04:01:08 
Re: Finding latest modified directory
foxidrive <gotcha@[EMA  2008-06-09 21:52:32 
Re: Finding latest modified directory
Pontus <pontus.laurell  2008-06-09 05:39:57 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sun Sep 7 8:36:48 CDT 2008.