[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Document Retention File Copy

Posted on 2011-03-25
5
Medium Priority
?
282 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
  • 2
4 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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

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…
Ever notice how you can't use a new drive in Windows without having Windows assigning a Disk Signature?  Ever have a signature collision problem (especially with Virtual Machines?)  This article is intended to help you understand what's going on and…
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…
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…

873 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