sandiegophil Posted March 22, 2011 Share Posted March 22, 2011 Hello, I am looking for a way to search for and delete orphaned backup files over a series of approximately 150-160 project directories. Any help and/or insight would be appreciated. Thanks, Phil Quote Link to comment Share on other sites More sharing options...
ReMark Posted March 22, 2011 Share Posted March 22, 2011 What methods have you tried so far to use to find these .bak files? Quote Link to comment Share on other sites More sharing options...
sandiegophil Posted March 22, 2011 Author Share Posted March 22, 2011 I have had zero success with any type of search/compare/list creation programs. Quote Link to comment Share on other sites More sharing options...
Patrick Hughes Posted March 22, 2011 Share Posted March 22, 2011 Simple enough with Windows Explorer, just navigate to the top directory and perform a search for *.bak and delete them. Quote Link to comment Share on other sites More sharing options...
Dana W Posted March 22, 2011 Share Posted March 22, 2011 The .bak files are created in the same folder that the original drawing is in. Quote Link to comment Share on other sites More sharing options...
sandiegophil Posted March 22, 2011 Author Share Posted March 22, 2011 I want to leave any .bak files that have matching .dwg files in place. My goal is to find any .bak files that do not have a matching .dwg file on a directory by directory basis. Employees will create temporary drawings for a specific use and then later delete it, but it leaves an orphaned backup file in the directory. Those are the files I am looking to find and delete. Thanks, Phil Quote Link to comment Share on other sites More sharing options...
Jack_O'neill Posted March 22, 2011 Share Posted March 22, 2011 As Patrick says, use your windows explorer to search for them. There are a couple of ways to do that. One, as he suggests, do an actual search. You can start that by hitting ctrl-f in the explorer window, or if you know which folder they are in already, simply navigate to the folder, then click on the word "type" on the menu bar just above where the files are displayed and it will sort by file extension. This will put all the .bak files together. If you have your explorer window set to show icons, you may need to click "view" and "details" first. Once they are sorted, you can click the first one, scroll down to the last one, hold the 'shift' key down and select the last one. This will highlight all the files between the first one you picked and the last one. You can then either right click and pick "delete" or hit the delete key. Quote Link to comment Share on other sites More sharing options...
ReMark Posted March 22, 2011 Share Posted March 22, 2011 It sounds to me as though you are now looking to play with fire. I'd be very careful about what you do next. Quote Link to comment Share on other sites More sharing options...
sandiegophil Posted March 22, 2011 Author Share Posted March 22, 2011 ReMark- You're 100% correct. This is a dangerous venture. However, there are so many of the orphaned backup files that it would really free up a lot of server space. Quote Link to comment Share on other sites More sharing options...
Jack_O'neill Posted March 22, 2011 Share Posted March 22, 2011 I want to leave any .bak files that have matching .dwg files in place. My goal is to find any .bak files that do not have a matching .dwg file on a directory by directory basis. Employees will create temporary drawings for a specific use and then later delete it, but it leaves an orphaned backup file in the directory. Those are the files I am looking to find and delete. Thanks, Phil You posted this a couple minutes before I hit the post button. You can still use the method I described, but sort by name instead of type. You'd just have to pick them out. There's a way to have all the files in a directory output to a comma delimited file which you can then sort with excel, but I can't recall how to do it right off the top of my head. I'll see if I can remember it and post it later. Quote Link to comment Share on other sites More sharing options...
ReMark Posted March 22, 2011 Share Posted March 22, 2011 Sort by name will work but who wants the tedium of going through the list of bak files to determine which are which? If that is a method you want to try then pick a single name followed by n underscore and number such as Mockup_1 or Temp_1 or Preliminary_1. The next person to come along and create a temporary drawing just indexes the number. Finding all the Temp_*.bak files will be a lot easier. Do it using a batch file. Hey Jack...you remember .bat files right? Quote Link to comment Share on other sites More sharing options...
sandiegophil Posted March 22, 2011 Author Share Posted March 22, 2011 I can port the file lists to excel but can't successfully compare the 2 lists containing 347,185 files in 48,857 directories. I think I may be attempting the near ridiculous......... Quote Link to comment Share on other sites More sharing options...
sandiegophil Posted March 22, 2011 Author Share Posted March 22, 2011 I end up with 2 lists by using: dir *.dwg /s>c:\drawings.txt and dir *.bak /s>c:\backup.txt any help getting these 2 files to 'talk' and cancel each other out would give me a list I could do a batch delete from......... help!! Quote Link to comment Share on other sites More sharing options...
ReMark Posted March 22, 2011 Share Posted March 22, 2011 You have no set routine in place for cleaning out BAK files on a regular basis? Does your IT department create nightly backups of all DWG files on the server? Quote Link to comment Share on other sites More sharing options...
Jack_O'neill Posted March 22, 2011 Share Posted March 22, 2011 Ok..had to go do it to remember. Open a command prompt window and navigate to the directory you wish to sort. type in "dir/s>text.txt" You can substitute any name you wish for the word text. At any rate, this will give you a list of all the files and related information in a txt file. You can then open that file with excel as fixed width, which you can then manipulate with all the sorting and editing capabilities that excel has to offer. Quote Link to comment Share on other sites More sharing options...
sandiegophil Posted March 22, 2011 Author Share Posted March 22, 2011 no standard for cleaning house when I started. Our IT group creates the backups (very reliable) Quote Link to comment Share on other sites More sharing options...
Jack_O'neill Posted March 22, 2011 Share Posted March 22, 2011 you guys all type faster than i do Quote Link to comment Share on other sites More sharing options...
sandiegophil Posted March 22, 2011 Author Share Posted March 22, 2011 (sorry Jack) Quote Link to comment Share on other sites More sharing options...
ReMark Posted March 22, 2011 Share Posted March 22, 2011 Are the backups created on a daily basis? Yes/No/I don't know? If they are then I'd write a batch file that erases ALL bak files (created by AutoCAD) either at the end of each day or at the end of the week and run it religiously. Quote Link to comment Share on other sites More sharing options...
Jack_O'neill Posted March 22, 2011 Share Posted March 22, 2011 (sorry Jack) :lol: Nothing to be sorry for...anyway...take your two files, paste the files names from one into a column next to the names in the other, then take a look at this link for instructions on how to compare the data to find duplicates. You can use the find and replace tool to get rid of the file extensions in both columns, leaving you with only the actual name. Once you find and eliminate the file names that duplicate, what you have left should be the orphans. http://support.microsoft.com/kb/213367?app=ZXL&ver=12 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.