Solved

Xcopy / Robocopy Question

Posted on 2016-09-29
7
64 Views
Last Modified: 2016-10-15
All,
I have a very large directory that I need to copy the contents of, but very simply, I need to copy the files that are BEFORE 12/31/14.  
Is there a way to do that using any of the popular methods, XCopy, Robocopy, etc.?
It would also be create if this utility DELETED the source files after the copy, but that's 100% necessary.

Hopefully that makes sense, thanks in advance!
0
Comment
Question by:zito2000
7 Comments
 
LVL 24

Accepted Solution

by:
NVIT earned 500 total points
ID: 41821988
To copy, including empty subfolders:
robocopy /maxage:20141231 /e /r:1 /w:1 "c:\source folder" "d:\target folder"

Open in new window


To copy, including empty subfolders, and delete source folder and files:
robocopy /move /maxage:20141231 /e /r:1 /w:1 "c:\source folder" "d:\target folder"

Open in new window

0
 

Author Comment

by:zito2000
ID: 41822086
NVIT, thank you so much for the reply.
I'm not doubting you at all, I just want to triple check....
Does the /maxage:20141231 specify "move only things that are December 31, 2014 and LATER"...?  So it would take the  December 31, 2014 to present?  
Just want to be sure.

Thanks again!
0
 
LVL 24

Expert Comment

by:NVIT
ID: 41822158
Your original question says
...copy the files that are BEFORE 12/31/14.  

MAXAGE:n : MAXimum file AGE - exclude files older than n days/date.

MINAGE:n : MINimum file AGE - exclude files newer than n days/date.

To instill confidence, do on a test folder first. Especially since you're using the MOVE switch.

As an aside... Do you need other Security data, besides the default ?

http://ss64.com/nt/robocopy.html
0
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 
LVL 24

Assisted Solution

by:NVIT
NVIT earned 500 total points
ID: 41822188
Apologies. Should use MINAGE
0
 
LVL 2

Expert Comment

by:kapsionu
ID: 41822542
I suggest to use also /MT as multi-threaded copy option (the value is 8 by default) - helps a lot in time, if there are an army of small files involved :).
0
 

Assisted Solution

by:zito2000
zito2000 earned 0 total points
ID: 41842033
The final script I ended up using was:
robocopy /move /minage:20101231 /e /r:1 /w:1 "c:\source folder" "d:\target folder"
0
 

Expert Comment

by:Dhanraj Pratap
ID: 41844745
You could explore ForFiles
0

Featured Post

Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

VALIDATING DATES One method of validating dates is to jam the date into the DATE command and see if it accepts it by examining the system's errorlevel value. A non-zero result indicates failure. A typical example might look something like the fol…
Introduction: Recently, I got a requirement to zip all files individually with batch file script in Windows OS. I don't know much about scripting, but I searched Google and found a lot of examples and websites to complete my task. Finally, I was ab…
This tutorial will show how to push an installation of Backup Exec to an additional server in both 2012 and 2014 versions of the software. Click on the Backup Exec button in the upper left corner. From here, select Installation and Licensing, then I…
This tutorial will walk an individual through the steps necessary to install and configure the Windows Server Backup Utility. Directly connect an external storage device such as a USB drive, or CD\DVD burner: If the device is a USB drive, ensure i…

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now