?
Solved

Document Retention File Copy

Posted on 2011-03-25
5
Medium Priority
?
273 Views
Last Modified: 2012-05-11
I have a folder system for customers.
Each folder has a subfolder for each year since the customer folder was created i.e. x:\customer\Firstl\LetterOflastName\lastname_firstname_suffix\year.
Of this path, there may be multiple subfolders under each year.

We create a new folder each year (i.e. 2011) and delete folders older than 7 years (i.e. 2003).

We now need to keep files that contain the word "keep" somewhere in the filename.

These files must still be held in seperate folders by year, but not necessarily in the same root folder that they are in now. Is there a way to delete all files except those with *keep* in the filename. Better yet, copy files with *keep* in the filename, only in the 2003 subfolders, to a different sub-directory, while retaining the directory structure of the file? I can do a clean up by removing empty directories as a secondary step.
0
Comment
Question by:DP-Group
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
5 Comments
 
LVL 4

Accepted Solution

by:
FireW0lf earned 2000 total points
ID: 35216132
So X:\Microsoft\G\Gates_Bill_Mr\2010  ?

The easiest way of doing this would be to create 2 folders:
X:\All
X:\Keep

Move all folders into X:\All
Then, grab robocopy from Microsoft (it's free) as it has the ability to traverse sub directories
robocopy X:\All X:\Keep *keep*.* /S /DCOPY:T /COPYALL /MOVE

Open in new window


Option:
*keep*.* = Only act on anything with "keep" in the title
Flags used:
/S = Copy subdirectories, but not empty ones
/DCOPY:T = Copy folder timestamps
/COPYALL = Copy all file flags
/MOVE = Move, not copy

After it has completed, you should be left with X:\Keep - which contains the correct directory structure, but only the files with "keep in the name"
X:\All will contain what is left - for you to Archive onto tape and/or delete
0
 

Author Comment

by:DP-Group
ID: 35305294
Firewolf - thanks for the answer - Sorry I haven't had a chance to test yet. I am going to carve out some time to do that this week. Will post results (and hopefully an accepted solution / points). Thanks again!
0
 
LVL 4

Expert Comment

by:FireW0lf
ID: 35322816
No problem - if you decide you want to archive the whole tree, just remove the "/MOVE" option - this then COPIES instead of MOVES - so then you can archive X:\All and have a full backup before deleting it and using X:\Keep as your live copy
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 35957386
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

In a hurry?.. scroll down to "HERE's HOW TO DO IT" Section. Greetings All, I was going to post this as question/solution, but its seems more appropriate as an article considering its length.  I felt it important to illucidate all the details c…
Have you ever had a hard drive that you can't boot into, but need to change the registry? Here is the solution! This article guides you through accessing and editing a registry of a non-primary drive. To read registry information on a non-prim…
This video Micro Tutorial explains how to clone a hard drive using a commercial software product for Windows systems called Casper from Future Systems Solutions (FSS). Cloning makes an exact, complete copy of one hard disk drive (HDD) onto another d…
Windows 8 comes with a dramatically different user interface known as Metro. Notably missing from the new interface is a Start button and Start Menu. Many users do not like it, much preferring the interface of earlier versions — Windows 7, Windows X…

800 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