Solved

Can you help me with a robocopy command?

Posted on 2014-10-27
12
141 Views
Last Modified: 2014-11-06
A client has a mix of documents that were last modified before 2013 and after 2013.  We'd like to archive all documents before 2013, but don't want to lose our directory structure.  Would you help write a robocopy for this?


Thanks!
0
Comment
Question by:epichero22
  • 5
  • 5
12 Comments
 
LVL 29

Expert Comment

by:becraig
ID: 40406883
You need to look at using maxage / minage

robocopy source destination /MIR /minage 1/1/2013 

Open in new window


/minage:<N>
      

Specifies the minimum file age (exclude files newer than N days or date).

More info:
http://technet.microsoft.com/en-us/library/cc733145.aspx
0
 
LVL 11

Author Comment

by:epichero22
ID: 40406930
Will this move older files or simply copy them?
0
 
LVL 29

Expert Comment

by:becraig
ID: 40406958
In order to move we would have to add the /mov flag
/mov  Moves files, and deletes them from the source after they are copied.

That would delete the source once the copy is complete.

robocopy source destination /MIR /mov /minage 1/1/2013 

Open in new window

0
Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

 
LVL 11

Author Comment

by:epichero22
ID: 40407632
Here's what I used:

robocopy "source" "Destination" /MIR /move /minage:20131201

Slightly different from what you mentioned, namely the "move" vs. "mov".  Any concerns with that?
0
 
LVL 29

Accepted Solution

by:
becraig earned 500 total points
ID: 40407648
/move would also move folders, so if you have folders in the structure you want to move then that is appropriate.

One does files the other does files and folders.
0
 
LVL 11

Author Comment

by:epichero22
ID: 40411411
I've requested that this question be closed as follows:

Accepted answer: 0 points for epichero22's comment #a40407632
Assisted answer: 500 points for becraig's comment #a40406958

for the following reason:

The command provided wasn't exactly the correct.
0
 
LVL 29

Expert Comment

by:becraig
ID: 40411412
The question indicated files and not folders:
We'd like to archive all documents before 2013

Had the OP indicated folder moves, then the correct flag of /move would have been provided.

The key question:
A client has a mix of documents that were last modified before 2013 and after 2013.  We'd like to archive all documents before 2013, but don't want to lose our directory structure.  Would you help write a robocopy for this?

The answer for the question posed was the /minage flag
0
 
LVL 11

Author Comment

by:epichero22
ID: 40411424
Well, the minage parameter was also incorrect.  But I'm still awarding points.
0
 
LVL 29

Expert Comment

by:becraig
ID: 40411439
Can you tell me what was the problem with the minage parameter ?
Does it not work as described in the link provided ?

Did it not exclude files after the date specified in the command ?
If so please indicate, the value here is in ensuring the information given is correct or at least if it is not we move towards identifying the correct solutions.

Since you did not end up using the minage flag, can you identify what flag you did use this will help future users.
0
 
LVL 11

Author Closing Comment

by:epichero22
ID: 40425788
This was the command that we used and proved successful.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

While working, an annoying popup showing below will come and we cannot cancel or close it form the screen. The error message will come again and again.
Learn how to PXE Boot both BIOS & UEFI machines with DHCP Policies and Custom Vendor Classes
This Micro Tutorial will give you a introduction in two parts how to utilize Windows Live Movie Maker to its maximum capability. This will be demonstrated using Windows Live Movie Maker on Windows 7 operating system.
Windows 8 came with a dramatically different user interface known as Metro. Notably missing from that interface was a Start button and Start Menu. Microsoft responded to negative user feedback of the Metro interface, bringing back the Start button a…

730 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