Solved

Xcopy / Robocopy Question

Posted on 2016-09-29
7
68 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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Suggested Solutions

Being a system administrator some time we require to do things remotely, one of them is installing software. Here I am going to tell you how to install software through wmic (Windows management instrument console). I am not at all saying that this i…
The recent Microsoft changes on update philosophy for Windows pre-10 and their impact on existing WSUS implementations.
This tutorial will walk an individual through the steps necessary to join and promote the first Windows Server 2012 domain controller into an Active Directory environment running on Windows Server 2008. Determine the location of the FSMO roles by lo…
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles to another domain controller. Log onto the new domain controller with a user account t…

839 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