Solved

Can you help me with a robocopy command?

Posted on 2014-10-27
12
135 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 28

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 28

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
 
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 28

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
Don't lose your head updating email signatures!

Do your end users still have the wrong email signature? Do email signature updates bore you or fill you with a sense of dread? You can make this a whole lot easier on yourself by trusting an Exclaimer email signature management solution. Over 50 million users do...so should you!

 
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 28

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 28

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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
Today, still in the boom of Apple, PC's and products, nearly 50% of the computer users use Windows as graphical operating systems. If you are among those users who love windows, but are grappling to keep the system's hard drive optimized, then you s…
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…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

746 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

12 Experts available now in Live!

Get 1:1 Help Now