Setting condition with robo copy

require to setup robo copy to copy without overwrite option . Copy files and folder. Copy files according to date . for an example copy files from 1st April 2012 to 31 june 2012.
Doodad BoySupprtAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

LBTechSolOperations DirectorCommented:
robocopy "c:\****" "\\ShareLocation\Folder" /E /ZB /r:1 /W:1 /maxage:20120631 /minage:20160401  

/E - Empty Sub Directory
/r - Retry times
/W - Wait between retry
**--(yyyymmdd) Date format

I would run a quick test to confirm on a small set to alternate location be 100% sure

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
oBdACommented:
Start here; it's in test mode and will not copy anything; remove the /L at the end to run it for real.
robocopy.exe C:\Source D:\Target *.* /R:0 /NP /MAXAGE:20120401 /MINAGE:20120631 /XC /XN /XO  /L

Open in new window

/R:0 - No Retries (usually pointless in local/LAN copies)
/NP - No Progress (in case you want to log)
/MAXAGE - exclude files older than n days/date
/MINAGE - exclude files newer than n days/date
For the without overwrite option:
/XC - eXclude Changed files
/XN - eXclude Newer files
/XO - eXclude Older files
Doodad BoySupprtAuthor Commented:
Hi, I had used below switch, but seems nothing has been copied

I GETTING ZERO FILE COPIED

robocopy Source Target MT:128 /E /ZB /maxage:20120631 /minage:20160401 /XC /XN /XO /log+
CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

oBdACommented:
"20120631" is an invalid date. June only has 30 days.
Doodad BoySupprtAuthor Commented:
Hi oBdA,

I corrected the date, but i still found zero file copied after running the robocopy. please advice further
oBdACommented:
Define "found zero file copied".
What does the log and/or console output say?
Do you still have the /L argument in the command line?
This works just fine here, so you either have no files matching the age filter provided, or all files that would match are already in the target folder.
Doodad BoySupprtAuthor Commented:
Hi, no /L argument

But the source disk contain files, however robocopy did not perform the copy at all
LBTechSolOperations DirectorCommented:
When you run the cmd what output do you get? is this as simple as an invalid directory path (source or destination)?
oBdACommented:
Define "however robocopy did not perform the copy at all".
Again: What does the log and/or console output say?
"But the source disk contain files"
Again: you specified both a date filter and options to prevent robocopy from copying over existing files, so "contains" doesn't mean anything if the source either has no files matching the age filter provided, or all files that would match are already in the target folder.
If, for example, all files in the source are younger than April 2016, then there's nothing to copy.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Powershell

From novice to tech pro — start learning today.