Solved

Document Retention File Copy

Posted on 2011-03-25
5
259 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
5 Comments
 
LVL 4

Accepted Solution

by:
FireW0lf earned 500 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: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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

Suggested Solutions

This article covers how to install the Microsoft Windows Operating System (OS). What is covered in this article:  > Different Versions and Editions of the Windows OS  > Upgrading versus Fresh Installation of the OS           - Steps to take pr…
It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
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…
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…

685 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