Link to home
Start Free TrialLog in
Avatar of Ernesto
ErnestoFlag for Mexico

asked on

robocopy for today files

how do i transform this in a robocopy line

xcopy d:\  w:\  /s /a /C /D:02-03-2016

is any way to copy only the today files in robocopy format?
regards
edo
Avatar of NVIT
NVIT
Flag of United States of America image

robocopy d:\ w:\ /a /s /r:1 /w:1 /maxage:1

Open in new window


or...

robocopy d:\ w:\ /a /s /r:1 /w:1 /maxage:20160203

Open in new window

Avatar of Ernesto

ASKER

Tsm

I dont to change the date manualy i thinking in a schedule bat
and if i want to overwrite the file if exist an older one?
is that posible?

regards!
Avatar of Ernesto

ASKER

with this command

robocopy d:\ w:\ /a /s /r:1 /w:1 /maxage:1

the process its donde and run but do not copy nothing
is something missing?
regards
> the process its donde and run but do not copy nothing

It works here.

Since you are using the /a switch, this means files must have the archive attribute set. Else, they are not copied.

Also, it copies files with today's date, i.e. 2/4/16
> i want to overwrite the file if exist an older one?
It will overwrite older files.

It will not match file existences. e.g. If today, it copies file1.txt. Then tomorrow, you erase file1.txt from the source, the copy from yesterday will still be there. If you do not want this to happen, use the /mir switch. This will "mirror" the source.
Avatar of Ernesto

ASKER

come on you guys
please the sintax line
regards
ASKER CERTIFIED SOLUTION
Avatar of NVIT
NVIT
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Ernesto

ASKER

what you min mirror the source?
regards
Avatar of Ernesto

ASKER

still do nothing man
w: is a map network drive in another server
and do not copy nothing
i dont know whats going on
regards
> what you min mirror the source?
See my prior post: ID: 41449454
Avatar of Ernesto

ASKER

got it
do nothing any way, w: is clear now and not today files added
regards
Avatar of Ernesto

ASKER

think i got it

robocopy.exe D:\ w:\ /MIR /a /r:1 /w:1 /maxage:1
Are you running robocopy in a CMD window?
From that same window, can you manually...
- Make a folder using MKDIR W:\test1
- Copy any file using COPY WhateverFilename W:\
Avatar of Ernesto

ASKER

it copy the hole dir structure with today files  or not,
is any way to tell it copy only the dirs that contain files maxage:1?
regards