Solved

Xcopy / Robocopy Question

Posted on 2016-09-29
7
54 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 23

Accepted Solution

by:
NVIT earned 500 total points
Comment Utility
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
Comment Utility
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 23

Expert Comment

by:NVIT
Comment Utility
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
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 
LVL 23

Assisted Solution

by:NVIT
NVIT earned 500 total points
Comment Utility
Apologies. Should use MINAGE
0
 
LVL 2

Expert Comment

by:kapsionu
Comment Utility
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
Comment Utility
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
Comment Utility
You could explore ForFiles
0

Featured Post

Are your corporate email signatures appalling?

Is it scary how unprofessional your email signatures look? Do users create their own terrible designs and give themselves stupid job titles? You can make this a lot easier for yourself by choosing an email signature management solution from Exclaimer today.

Join & Write a Comment

Possible fixes for Windows 7 and Windows Server 2008 updating problem. Solutions mentioned are from Microsoft themselves. I started a case with them from our Microsoft Silver Partner option to open a case and get direct support from Microsoft. If s…
A safe way to clean winsxs folder from your windows server 2008 R2 editions
This tutorial will walk an individual through locating and launching the BEUtility application to properly change the service account username and\or password in situation where it may be necessary or where the password has been inadvertently change…
This tutorial will show how to configure a new Backup Exec 2012 server and move an existing database to that server with the use of the BEUtility. Install Backup Exec 2012 on the new server and apply all of the latest hotfixes and service packs. The…

743 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

16 Experts available now in Live!

Get 1:1 Help Now