Solved

Delete 2 of every 3 similarly named files via batch script --

Posted on 2011-02-23
30
264 Views
Last Modified: 2012-05-11
I have a directory of files, such as:

N:\SP\Fri 02112011- 00435.52mysqldmp.ra
N:\SP\Fri 02112011- 80631.90mysqldmp.ra
N:\SP\Fri 02112011-160543.27mysqldmp.ra
N:\SP\Sat 02122011- 00434.32mysqldmp.ra
N:\SP\Sat 02122011- 80639.59mysqldmp.ra
N:\SP\Sat 02122011-160552.60mysqldmp.ra
N:\SP\Sun 02132011- 00426.79mysqldmp.ra
N:\SP\Sun 02132011- 00428.52mysqldmp.ra
N:\SP\Sun 02132011- 80631.80mysqldmp.ra

I would like to be able to have a script that deleted 2 of the 3 02132011 files, etc.  It should always keep either the first, or the last of the 3 files for consistency, but I don't much care which.

It should give me a sample output of files to be deleted: i.e.

1) determine files to be deleted
2) copy these to a text file
3) pause, waiting for me to read/check the file
4) proceed to delete.

If there are 2 files that fit the pattern, it should only delete one.  If there is only 1 file, it should not touch it.
0
Comment
Question by:blakogre
  • 14
  • 10
  • 5
30 Comments
 
LVL 38

Expert Comment

by:Insignificant Volunteer
Comment Utility
Would a process like this be satisfactory?:

1. Copy one of each set of similarly named files out to another folder with verification
2. Delete all the files (or at least all the *.ra files) in the original folder
3. Move all the copied ones back into the original folder.

The steps above may not be necessary at all, but I'm just checking in advance because I am not able to write you a batch file at the moment.  I will look back later and see if anyone has provided a solution for you, then try and write something if not.
0
 
LVL 51

Expert Comment

by:Bill Prew
Comment Utility
So, what's the exact "pattern" to look for duplicates based on?  Meaning, in files named like:

N:\SP\Sun 02132011- 80631.80mysqldmp.ra

Is the "Sun 02132011" enough to look at to group, and remove all but one, or does the "mysqldmp.ra" have to be considered too?  Or is there only one file that will exist, just with different stamps?

~bp
0
 
LVL 9

Author Comment

by:blakogre
Comment Utility
@BillDL: I'd probably prefer not to move the files around -- but it can be done I s'pose if it simplifies the task.

@billprew: the consistent piece will be the Day Date portion (before the "-").  The next characters are the time, which will vary.  The end will actually be consistent as well, but you don't need to check for that.
0
 
LVL 38

Expert Comment

by:Insignificant Volunteer
Comment Utility
I'm a bit confused about why you would wish to automate this type of activity and yet still be shown the contents of the files and a prompt to delete or keep.

If that is really what you want, then something like this should work, dependent on the actual content of the *.RA files.  On my system the *.RA file type is associated with RealPlayer (Real Media), and I don't know whether your .RA files are plain text or not.  I can only assume that they are, given that you suggested copying the contents to text file.

 
@echo off
SetLocal EnableDelayedExpansion

REM set BaseDir=N:\SP
set BaseDir=C:\EE_Delete_Similar\SP

for /f "tokens=* delims=" %%A in ('dir /on /b /s "%BaseDir%\*.ra"') do (
    set CurrentFile=%%A
    "%SystemRoot%\System32\notepad.exe" "!CurrentFile!"
    echo.
    echo Keep or Delete last opened file? "K or D"
    echo.
    echo "!CurrentFile!"
    echo.
    echo.
    set /P YesNo=    Enter K or D:  
    if /i !YesNo! EQU D (
        del "!CurrentFile!" > nul
        echo.
        echo "!CurrentFile!" Deleted    
    ) else (
        echo.
        echo "!CurrentFile!" Retained
        set YesNo=
    )   
)

pause

Open in new window


Change the:
set BaseDir=C:\EE_Delete_Similar\SP
to:
set BaseDir=N:\SP
by removing the leading REM and deleting the line containing my test path.

As far as my previous suggestion of temporarily backing up the files you want to keep, perhaps this will work for you.  The quick theory first:

We create a text file containing a fully qualified path listing of all *.RA files in the specified folder, and we order the results by time of creation so the newest one is last in the list (dir /od /tC c:\path\*.ra)

Assuming that the file naming convention is consistent in the format:
Drive:\MasterFolder\Fri 02112011 - 00435.52mysqldmp.ra
we will capture the date part of the file names (ddmmyyyy) by splitting the path up into chunks using the \ space - and . delimiters.  So the ddmmyyyy part will be the 3rd token (chunk) of each string.

We walk through the directory listing one line at a time, and for each full path read in, we:

1. Store the ddmmyyyy part of each file name as a variable.
2. Do a Directory listing ordered by time of creation (newest last), using the stored variable and .ra file extension as our filters, and capture the full path of ONLY the last file listed that matches, ie. the most recently created file.
3. Copy that file to a sub-folder created for the purpose.

Once all the files in the master folder have been processed the same way, and the most recent of each "cluster" of "similarly named" files copied to the other folder, we:

1. Delete all the *.RA files in the master folder
2. Copy the ones we placed aside in the sub-folder back into the master folder
3. Delete the folder used for the temporary placement of files.

The batch file at the moment DOES NOT prompt for any choices from you.  It only provides you with feedback of what actions are currently being performed.  What I am not clear about is why you would need to automate this using a batch file, but be presented with the contents of each file so you can decide which file to delete or keep.  It kind of

You should obviously test this on a folder of copies of your files to ascertain that it works before deploying it on a real folder.

 
@echo off
SetLocal EnableDelayedExpansion

REM set BaseDir=N:\SP
set BaseDir=C:\EE_Delete_Similar\SP

set TempDest=%BaseDir%\_tempDest
if not exist "%TempDest%" md "%TempDest%"

echo Creating temporary folder for copied files:
echo "%TempDest%"
echo.

echo Creating listing of files in the folder:
echo "%BaseDir%"
echo.

dir /od /tC /b /s "%BaseDir%\*.ra">_RaFiles.txt

echo Copying most recently created .RA file from folder:
echo "%BaseDir%"
echo to the temporary folder:
echo "%TempDest%"
echo.

for /f "tokens=5 delims=^\^.- " %%A in (_RaFiles.txt) do (
    set WildCard=%%A
        for /f "tokens=* delims=" %%B in ('dir /od /tC /b /s "%BaseDir%\*!WildCard!*.ra"') do (
            set KeepFile=%%B
        )
        echo.
        copy "!KeepFile!" "%TempDest%" > nul 
)

echo.
echo Removing all .RA files from folder:
echo "%BaseDir%"
echo and moving backed-up .RA files from temp folder back into:
echo echo "%BaseDir%"
echo.

if exist "%BaseDir%\*.ra" del "%BaseDir%\*.ra" > nul
copy "%TempDest%\*.ra" "%BaseDir%\*.ra" > nul
if exist "%TempDest%\*.ra" del "%TempDest%\*.ra" > nul
rd /q "%TempDest%"

echo.
echo FINISHED!
echo.

pause

Open in new window


I'm sure Bill Prew will be back shortly with a very eloquent one-liner ;-)
0
 
LVL 38

Expert Comment

by:Insignificant Volunteer
Comment Utility
Excuse the leftover bit of text in the 2nd last paragraph. I copied and pasted it further up the comment and forgot to delete the orginal.
0
 
LVL 9

Author Comment

by:blakogre
Comment Utility
these are backup files.  i need to be sure the script is deleting the right files.  i do not want to confirm one by one, but if i see a text file of what's going/what's staying, that i can quickly browse -- then i can be confident that it's working, and then delete the portion so it just executes deleting of the proper files.
0
 
LVL 38

Expert Comment

by:Insignificant Volunteer
Comment Utility
What is the most reliable verification that you can use to determine which of the files for one day (ie. those with the same date in the file name) you would always want to keep?

Are they revisions of the same content that are appended to during the day, and the last modified one will always be the final version?

What is the significance of the number after the date in the file name?  The Time?
0
 
LVL 9

Author Comment

by:blakogre
Comment Utility
These are mysql dumps of DBs, done every 8 hours, creating 3 backups a day.  After enough time passes, they aren't all needed.

it is day of the week / date / time - constant string.ra

in fact, the sample is slightly misleading -- this is a good sample:
N:\SP\Fri 02112011- 00435.52mysqldmp.ra
N:\SP\Fri 02112011- 80631.90mysqldmp.ra
N:\SP\Fri 02112011-160543.27mysqldmp.ra

Time will always have a 00, an 80, and a 16 in front - one of those 3.

The DB changes, each day, so there is no "final version".

I have 3 copies of the data, as well, the live on the server, and 2 offsite that are mirrored, so i will try this on one of the mirrors, and re-mirror if there's an issue.  once i'm comfortable, i'll remove the verification piece.
0
 
LVL 51

Expert Comment

by:Bill Prew
Comment Utility
See what you think of this approach.  It creates a folder named delete under your base folder, and looks through the existing files moving older same day files ("dupes") to that folder to stage them for delete.  It shows the files it will keep versus delete to the screen.  Then it asks for confirmation to delete.  If given the DELETE folder files are removed.  If confirmation is not given, the files are moved back to the base folder.

@echo off
setlocal EnableDelayedExpansion

REM Define location of backup files, and create a work folder for delete candidates
set BaseDir=x:\_xfer\ee\EE26842813
REM set BaseDir=N:\SP
set DelDir=%BaseDir%\delete
if not exist "%DelDir%" md "%DelDir%"

REM Process all files in base folder, keepin the most recent one
set Last=
for /F "tokens=*" %%A in ('dir /b /a-d "%BaseDir%" ^| sort /R') do (
  for /F "tokens=1 delims=-" %%B in ("%%~nA") do (
    if "%%B" EQU "!Last!" (
      echo DELETE: "%%A"
      move "%%A" "%DelDir%" >NUL
    ) else (
      echo KEEP  : "%%A"
      set Last=%%B
    )
  )
)

REM Confirm delete, or move files back if no confirmation
echo.
set /P "Confirm=Delete of these files? (Y/N): "
if "%Confirm%" EQU "Y" (
  del /Q "%DelDir%"
) else (
  move "%DelDir%\*.*" "%BaseDir%" >NUL
)

Open in new window


Here's the output from my test with your example files:

KEEP  : "Sun 02132011- 80631.80mysqldmp.ra"
DELETE: "Sun 02132011- 00428.52mysqldmp.ra"
DELETE: "Sun 02132011- 00426.79mysqldmp.ra"
KEEP  : "Sat 02122011-160552.60mysqldmp.ra"
DELETE: "Sat 02122011- 80639.59mysqldmp.ra"
DELETE: "Sat 02122011- 00434.32mysqldmp.ra"
KEEP  : "Fri 02112011-160543.27mysqldmp.ra"
DELETE: "Fri 02112011- 80631.90mysqldmp.ra"
DELETE: "Fri 02112011- 00435.52mysqldmp.ra"

Delete of these files? (Y/N): Y

Open in new window

~bp
0
 
LVL 38

Expert Comment

by:Insignificant Volunteer
Comment Utility
I'm pretty sure that you will go for Bill Prew's last batch file.  he has the better approach of moving out the "dupes" for deletion and leaving the "keepers", rather than mine of temporarily moving out the "keepers" and then returning them after clearing out the "dupes".

Just for clarification, when I earlier asked about "final versions" and you explained:
"The DB changes, each day, so there is no 'final version'."
you seem to have answered what I was asking, ie. which file generated for each day would be the "final version".  So it would be fair to assume that the most recently saved file for each group of files with the same date in the file names would be the "keeper"?

0
 
LVL 9

Author Comment

by:blakogre
Comment Utility
Hey BillDl --

usually -- sure, you'd keep the most recent.  However, in this situation, I'm not running this daily -- I have 6 months of files, and i'm only going to use this for the first 3 of those 6 months, just for archival purposes, so we don't really need *the latest* in this situation.  make sense?

@billprew:

I'm attaching a text file dir listing for you to work with.  The output is not as expected -- in part due to a few files in there of different format, which I can be moved -- but also an odd missing-file statement.  Additionally, the number of files is large so I lose some of the "report".

Thanks,
Mike
dir.txt
0
 
LVL 51

Expert Comment

by:Bill Prew
Comment Utility
This small change should help only process the files that match the exact format you are looking for, notice use of wildcards on the DIR command now.

Can you be more specific on what "the output is not as expected" means?  When I ran your test file set I got the listing below, help me understand where the problems are.

As far as the loss of some of the report, how would you like to handle that.  I can imagine two approaches.  We could still do it in the DOS window, but pause when a screen is full waiting for a keystroke to display more.  Or we could save that report to a TXT file and open Notepad for a review before continuing.  Or open to any other thoughts you have?

~bp

@echo off
setlocal EnableDelayedExpansion

REM Define location of backup files, and create a work folder for delete candidates
set BaseDir=N:\SP
set DelDir=%BaseDir%\delete
if not exist "%DelDir%" md "%DelDir%"

REM Process all files in base folder, keepin the most recent one
set Last=
for /F "tokens=*" %%A in ('dir /b /a-d "%BaseDir%\??? ????????-??????.??mysqldmp.rar" ^| sort /R') do (
  for /F "tokens=1 delims=-" %%B in ("%%~nA") do (
    if "%%B" EQU "!Last!" (
      echo DELETE: "%%A"
      move "%%A" "%DelDir%" >NUL
    ) else (
      echo KEEP  : "%%A"
      set Last=%%B
    )
  )
)

REM Confirm delete, or move files back if no confirmation
echo.
set /P "Confirm=Confirm delete of these files? (Y/N): "
if "%Confirm%" EQU "Y" (
  del /Q "%DelDir%"
) else (
  move "%DelDir%\*.*" "%BaseDir%" >NUL
)

Open in new window


KEEP  : "Wed 12292010-160539.25mysqldmp.rar"
DELETE: "Wed 12292010- 80616.97mysqldmp.rar"
DELETE: "Wed 12292010- 00419.89mysqldmp.rar"
KEEP  : "Wed 12222010-160526.12mysqldmp.rar"
DELETE: "Wed 12222010- 80626.03mysqldmp.rar"
DELETE: "Wed 12222010- 00416.51mysqldmp.rar"
KEEP  : "Wed 12152010-160551.19mysqldmp.rar"
DELETE: "Wed 12152010- 80614.22mysqldmp.rar"
DELETE: "Wed 12152010- 00411.09mysqldmp.rar"
KEEP  : "Wed 12082010-160513.48mysqldmp.rar"
DELETE: "Wed 12082010- 80612.31mysqldmp.rar"
DELETE: "Wed 12082010- 00417.63mysqldmp.rar"
KEEP  : "Wed 12012010-160512.09mysqldmp.rar"
DELETE: "Wed 12012010- 80611.70mysqldmp.rar"
DELETE: "Wed 12012010- 00411.64mysqldmp.rar"
KEEP  : "Wed 11242010-160511.19mysqldmp.rar"
DELETE: "Wed 11242010- 80603.07mysqldmp.rar"
DELETE: "Wed 11242010- 00409.03mysqldmp.rar"
KEEP  : "Wed 11172010-160458.73mysqldmp.rar"
DELETE: "Wed 11172010- 80609.70mysqldmp.rar"
DELETE: "Wed 11172010- 00358.56mysqldmp.rar"
KEEP  : "Wed 11102010-160503.19mysqldmp.rar"
DELETE: "Wed 11102010- 80557.92mysqldmp.rar"
DELETE: "Wed 11102010- 00358.00mysqldmp.rar"
KEEP  : "Wed 11032010-160517.54mysqldmp.rar"
DELETE: "Wed 11032010- 80603.14mysqldmp.rar"
DELETE: "Wed 11032010- 00357.14mysqldmp.rar"
KEEP  : "Wed 10272010-160519.58mysqldmp.rar"
DELETE: "Wed 10272010- 80554.87mysqldmp.rar"
DELETE: "Wed 10272010- 00417.74mysqldmp.rar"
KEEP  : "Wed 10202010-160526.58mysqldmp.rar"
DELETE: "Wed 10202010- 80554.54mysqldmp.rar"
DELETE: "Wed 10202010- 00354.34mysqldmp.rar"
KEEP  : "Wed 10132010-160503.85mysqldmp.rar"
DELETE: "Wed 10132010- 80555.71mysqldmp.rar"
DELETE: "Wed 10132010- 00359.36mysqldmp.rar"
KEEP  : "Wed 10062010-160513.43mysqldmp.rar"
DELETE: "Wed 10062010- 80549.27mysqldmp.rar"
DELETE: "Wed 10062010- 00351.47mysqldmp.rar"
KEEP  : "Wed 09292010-160505.65mysqldmp.rar"
DELETE: "Wed 09292010- 80554.79mysqldmp.rar"
DELETE: "Wed 09292010- 00351.72mysqldmp.rar"
KEEP  : "Wed 09222010-160533.86mysqldmp.rar"
DELETE: "Wed 09222010- 80553.08mysqldmp.rar"
DELETE: "Wed 09222010- 00405.21mysqldmp.rar"
KEEP  : "Wed 09152010-160502.79mysqldmp.rar"
DELETE: "Wed 09152010- 80544.73mysqldmp.rar"
DELETE: "Wed 09152010- 00351.26mysqldmp.rar"
KEEP  : "Wed 09082010-160512.31mysqldmp.rar"
DELETE: "Wed 09082010- 80536.08mysqldmp.rar"
DELETE: "Wed 09082010- 00346.44mysqldmp.rar"
KEEP  : "Wed 09012010-160449.11mysqldmp.rar"
DELETE: "Wed 09012010- 80536.90mysqldmp.rar"
DELETE: "Wed 09012010- 00340.74mysqldmp.rar"
KEEP  : "Wed 08252010-160453.75mysqldmp.rar"
DELETE: "Wed 08252010- 80533.93mysqldmp.rar"
DELETE: "Wed 08252010- 00335.01mysqldmp.rar"
KEEP  : "Wed 08182010-160440.30mysqldmp.rar"
DELETE: "Wed 08182010- 80535.80mysqldmp.rar"
DELETE: "Wed 08182010- 00336.03mysqldmp.rar"
KEEP  : "Wed 08112010-160433.81mysqldmp.rar"
DELETE: "Wed 08112010- 80531.36mysqldmp.rar"
DELETE: "Wed 08112010- 00340.40mysqldmp.rar"
KEEP  : "Wed 08042010-160432.36mysqldmp.rar"
DELETE: "Wed 08042010- 80531.55mysqldmp.rar"
DELETE: "Wed 08042010- 00335.70mysqldmp.rar"
KEEP  : "Wed 07282010- 80538.83mysqldmp.rar"
KEEP  : "Wed 02162011-160541.08mysqldmp.rar"
DELETE: "Wed 02162011- 80633.32mysqldmp.rar"
DELETE: "Wed 02162011- 00433.57mysqldmp.rar"
KEEP  : "Wed 02092011-160614.44mysqldmp.rar"
DELETE: "Wed 02092011- 80634.46mysqldmp.rar"
DELETE: "Wed 02092011- 00445.42mysqldmp.rar"
KEEP  : "Wed 02022011-160603.49mysqldmp.rar"
DELETE: "Wed 02022011- 80632.48mysqldmp.rar"
DELETE: "Wed 02022011- 00432.86mysqldmp.rar"
KEEP  : "Wed 01262011-160540.23mysqldmp.rar"
DELETE: "Wed 01262011- 80629.48mysqldmp.rar"
DELETE: "Wed 01262011- 00433.50mysqldmp.rar"
KEEP  : "Wed 01192011-160544.39mysqldmp.rar"
DELETE: "Wed 01192011- 80628.07mysqldmp.rar"
DELETE: "Wed 01192011- 00450.45mysqldmp.rar"
KEEP  : "Wed 01122011-160537.82mysqldmp.rar"
DELETE: "Wed 01122011- 80624.60mysqldmp.rar"
DELETE: "Wed 01122011- 00422.94mysqldmp.rar"
KEEP  : "Wed 01052011-160545.59mysqldmp.rar"
DELETE: "Wed 01052011- 80623.27mysqldmp.rar"
DELETE: "Wed 01052011- 00421.88mysqldmp.rar"
KEEP  : "Tue 12282010-160535.06mysqldmp.rar"
DELETE: "Tue 12282010- 80629.17mysqldmp.rar"
DELETE: "Tue 12282010- 00419.40mysqldmp.rar"
KEEP  : "Tue 12212010-160536.65mysqldmp.rar"
DELETE: "Tue 12212010- 80626.50mysqldmp.rar"
DELETE: "Tue 12212010- 00414.08mysqldmp.rar"
KEEP  : "Tue 12142010-160514.94mysqldmp.rar"
DELETE: "Tue 12142010- 80620.91mysqldmp.rar"
DELETE: "Tue 12142010- 00414.85mysqldmp.rar"
KEEP  : "Tue 12072010-160515.63mysqldmp.rar"
DELETE: "Tue 12072010- 80616.19mysqldmp.rar"
DELETE: "Tue 12072010- 00412.64mysqldmp.rar"
KEEP  : "Tue 11302010-160510.00mysqldmp.rar"
DELETE: "Tue 11302010- 80609.16mysqldmp.rar"
DELETE: "Tue 11302010- 00410.87mysqldmp.rar"
KEEP  : "Tue 11232010-160510.40mysqldmp.rar"
DELETE: "Tue 11232010- 80604.95mysqldmp.rar"
DELETE: "Tue 11232010- 00406.18mysqldmp.rar"
KEEP  : "Tue 11162010-160503.36mysqldmp.rar"
DELETE: "Tue 11162010- 80604.96mysqldmp.rar"
DELETE: "Tue 11162010- 00401.22mysqldmp.rar"
KEEP  : "Tue 11092010-160516.16mysqldmp.rar"
DELETE: "Tue 11092010- 80559.04mysqldmp.rar"
DELETE: "Tue 11092010- 00403.24mysqldmp.rar"
KEEP  : "Tue 11022010-160512.36mysqldmp.rar"
DELETE: "Tue 11022010- 80604.23mysqldmp.rar"
DELETE: "Tue 11022010- 00355.16mysqldmp.rar"
KEEP  : "Tue 10262010-160518.73mysqldmp.rar"
DELETE: "Tue 10262010- 80556.96mysqldmp.rar"
DELETE: "Tue 10262010- 00359.97mysqldmp.rar"
KEEP  : "Tue 10192010-160451.39mysqldmp.rar"
DELETE: "Tue 10192010- 80551.29mysqldmp.rar"
KEEP  : "Tue 10122010-160520.11mysqldmp.rar"
DELETE: "Tue 10122010- 80554.93mysqldmp.rar"
DELETE: "Tue 10122010- 00356.92mysqldmp.rar"
KEEP  : "Tue 10052010-160448.26mysqldmp.rar"
DELETE: "Tue 10052010- 80600.32mysqldmp.rar"
DELETE: "Tue 10052010- 00354.17mysqldmp.rar"
KEEP  : "Tue 09282010-160502.67mysqldmp.rar"
DELETE: "Tue 09282010- 80548.78mysqldmp.rar"
DELETE: "Tue 09282010- 00407.63mysqldmp.rar"
KEEP  : "Tue 09212010-160508.66mysqldmp.rar"
DELETE: "Tue 09212010- 80552.17mysqldmp.rar"
DELETE: "Tue 09212010- 00352.34mysqldmp.rar"
KEEP  : "Tue 09142010-160457.33mysqldmp.rar"
DELETE: "Tue 09142010- 80541.79mysqldmp.rar"
DELETE: "Tue 09142010- 00342.04mysqldmp.rar"
KEEP  : "Tue 09072010-160455.19mysqldmp.rar"
DELETE: "Tue 09072010- 80541.60mysqldmp.rar"
DELETE: "Tue 09072010- 00350.57mysqldmp.rar"
KEEP  : "Tue 08312010-160459.24mysqldmp.rar"
DELETE: "Tue 08312010- 80537.50mysqldmp.rar"
DELETE: "Tue 08312010- 00336.92mysqldmp.rar"
KEEP  : "Tue 08242010-160444.20mysqldmp.rar"
DELETE: "Tue 08242010- 80539.90mysqldmp.rar"
DELETE: "Tue 08242010- 00331.52mysqldmp.rar"
KEEP  : "Tue 08172010-160449.76mysqldmp.rar"
DELETE: "Tue 08172010- 80530.57mysqldmp.rar"
DELETE: "Tue 08172010- 00334.79mysqldmp.rar"
KEEP  : "Tue 08102010-160432.60mysqldmp.rar"
DELETE: "Tue 08102010- 80532.14mysqldmp.rar"
DELETE: "Tue 08102010- 00334.69mysqldmp.rar"
KEEP  : "Tue 08032010-160431.50mysqldmp.rar"
DELETE: "Tue 08032010- 80527.60mysqldmp.rar"
DELETE: "Tue 08032010- 00329.83mysqldmp.rar"
KEEP  : "Tue 07272010-192745.02mysqldmp.rar"
DELETE: "Tue 07272010- 85846.89mysqldmp.rar"
KEEP  : "Tue 02152011-160611.73mysqldmp.rar"
DELETE: "Tue 02152011- 80630.77mysqldmp.rar"
DELETE: "Tue 02152011- 00438.51mysqldmp.rar"
KEEP  : "Tue 02082011-160545.54mysqldmp.rar"
DELETE: "Tue 02082011- 80655.51mysqldmp.rar"
DELETE: "Tue 02082011- 00435.71mysqldmp.rar"
KEEP  : "Tue 02012011-160601.44mysqldmp.rar"
DELETE: "Tue 02012011- 80636.60mysqldmp.rar"
DELETE: "Tue 02012011- 00428.81mysqldmp.rar"
KEEP  : "Tue 01252011-160614.95mysqldmp.rar"
DELETE: "Tue 01252011- 80630.20mysqldmp.rar"
DELETE: "Tue 01252011- 00452.37mysqldmp.rar"
KEEP  : "Tue 01182011-160548.10mysqldmp.rar"
DELETE: "Tue 01182011- 80626.16mysqldmp.rar"
DELETE: "Tue 01182011- 00424.22mysqldmp.rar"
KEEP  : "Tue 01112011-160535.47mysqldmp.rar"
DELETE: "Tue 01112011- 80621.61mysqldmp.rar"
DELETE: "Tue 01112011- 00425.61mysqldmp.rar"
KEEP  : "Tue 01042011-160537.98mysqldmp.rar"
DELETE: "Tue 01042011- 80625.79mysqldmp.rar"
DELETE: "Tue 01042011- 00424.72mysqldmp.rar"
KEEP  : "Thu 12302010-160604.11mysqldmp.rar"
DELETE: "Thu 12302010- 80619.16mysqldmp.rar"
DELETE: "Thu 12302010- 00420.78mysqldmp.rar"
KEEP  : "Thu 12232010-160521.94mysqldmp.rar"
DELETE: "Thu 12232010- 80612.83mysqldmp.rar"
DELETE: "Thu 12232010- 00416.52mysqldmp.rar"
KEEP  : "Thu 12162010-160526.46mysqldmp.rar"
DELETE: "Thu 12162010- 80611.78mysqldmp.rar"
DELETE: "Thu 12162010- 00417.40mysqldmp.rar"
KEEP  : "Thu 12092010-160511.94mysqldmp.rar"
DELETE: "Thu 12092010- 80613.28mysqldmp.rar"
DELETE: "Thu 12092010- 00416.75mysqldmp.rar"
KEEP  : "Thu 12022010-160513.94mysqldmp.rar"
DELETE: "Thu 12022010- 80610.64mysqldmp.rar"
DELETE: "Thu 12022010- 00412.02mysqldmp.rar"
KEEP  : "Thu 11252010-160505.16mysqldmp.rar"
DELETE: "Thu 11252010- 80609.41mysqldmp.rar"
DELETE: "Thu 11252010- 00409.26mysqldmp.rar"
KEEP  : "Thu 11182010-160504.44mysqldmp.rar"
DELETE: "Thu 11182010- 80658.51mysqldmp.rar"
DELETE: "Thu 11182010- 00426.16mysqldmp.rar"
KEEP  : "Thu 11112010-160503.80mysqldmp.rar"
DELETE: "Thu 11112010- 80600.71mysqldmp.rar"
DELETE: "Thu 11112010- 00402.40mysqldmp.rar"
KEEP  : "Thu 11042010-160600.06mysqldmp.rar"
DELETE: "Thu 11042010- 80559.22mysqldmp.rar"
DELETE: "Thu 11042010- 00414.99mysqldmp.rar"
KEEP  : "Thu 10282010-160513.41mysqldmp.rar"
DELETE: "Thu 10282010- 80555.34mysqldmp.rar"
DELETE: "Thu 10282010- 00357.09mysqldmp.rar"
KEEP  : "Thu 10212010-160508.70mysqldmp.rar"
DELETE: "Thu 10212010- 80552.66mysqldmp.rar"
DELETE: "Thu 10212010- 00352.82mysqldmp.rar"
KEEP  : "Thu 10142010-160548.04mysqldmp.rar"
DELETE: "Thu 10142010- 80554.72mysqldmp.rar"
DELETE: "Thu 10142010- 00403.95mysqldmp.rar"
KEEP  : "Thu 10072010-160506.40mysqldmp.rar"
DELETE: "Thu 10072010- 80552.83mysqldmp.rar"
DELETE: "Thu 10072010- 00352.74mysqldmp.rar"
KEEP  : "Thu 09302010-160510.94mysqldmp.rar"
DELETE: "Thu 09302010- 80558.15mysqldmp.rar"
DELETE: "Thu 09302010- 00354.80mysqldmp.rar"
KEEP  : "Thu 09232010-160503.01mysqldmp.rar"
DELETE: "Thu 09232010- 80551.59mysqldmp.rar"
DELETE: "Thu 09232010- 00347.92mysqldmp.rar"
KEEP  : "Thu 09162010-160503.03mysqldmp.rar"
DELETE: "Thu 09162010- 80547.57mysqldmp.rar"
DELETE: "Thu 09162010- 00351.63mysqldmp.rar"
KEEP  : "Thu 09092010-160511.63mysqldmp.rar"
DELETE: "Thu 09092010- 80541.84mysqldmp.rar"
DELETE: "Thu 09092010- 00347.56mysqldmp.rar"
KEEP  : "Thu 09022010-160448.34mysqldmp.rar"
DELETE: "Thu 09022010- 80544.36mysqldmp.rar"
DELETE: "Thu 09022010- 00339.56mysqldmp.rar"
KEEP  : "Thu 08262010-160446.55mysqldmp.rar"
DELETE: "Thu 08262010- 80536.58mysqldmp.rar"
DELETE: "Thu 08262010- 00337.65mysqldmp.rar"
KEEP  : "Thu 08192010-160440.49mysqldmp.rar"
DELETE: "Thu 08192010- 80528.84mysqldmp.rar"
DELETE: "Thu 08192010- 00338.03mysqldmp.rar"
KEEP  : "Thu 08122010-160429.89mysqldmp.rar"
DELETE: "Thu 08122010- 80528.74mysqldmp.rar"
DELETE: "Thu 08122010- 00429.61mysqldmp.rar"
KEEP  : "Thu 08052010-160435.18mysqldmp.rar"
DELETE: "Thu 08052010- 80529.71mysqldmp.rar"
DELETE: "Thu 08052010- 00336.44mysqldmp.rar"
KEEP  : "Thu 02172011-160601.64mysqldmp.rar"
DELETE: "Thu 02172011- 80642.81mysqldmp.rar"
DELETE: "Thu 02172011- 00438.24mysqldmp.rar"
KEEP  : "Thu 02102011-160556.57mysqldmp.rar"
DELETE: "Thu 02102011- 80639.65mysqldmp.rar"
DELETE: "Thu 02102011- 00448.54mysqldmp.rar"
KEEP  : "Thu 02032011-160546.18mysqldmp.rar"
DELETE: "Thu 02032011- 80632.19mysqldmp.rar"
DELETE: "Thu 02032011- 00434.35mysqldmp.rar"
KEEP  : "Thu 01272011-160541.44mysqldmp.rar"
DELETE: "Thu 01272011- 80629.82mysqldmp.rar"
DELETE: "Thu 01272011- 00427.49mysqldmp.rar"
KEEP  : "Thu 01202011-160603.18mysqldmp.rar"
DELETE: "Thu 01202011- 80630.64mysqldmp.rar"
DELETE: "Thu 01202011- 00429.71mysqldmp.rar"
KEEP  : "Thu 01132011-160547.38mysqldmp.rar"
DELETE: "Thu 01132011- 80630.34mysqldmp.rar"
DELETE: "Thu 01132011- 00426.87mysqldmp.rar"
KEEP  : "Thu 01062011-160541.92mysqldmp.rar"
DELETE: "Thu 01062011- 80614.53mysqldmp.rar"
DELETE: "Thu 01062011- 00423.15mysqldmp.rar"
KEEP  : "Sun 12262010-160521.31mysqldmp.rar"
DELETE: "Sun 12262010- 80626.07mysqldmp.rar"
DELETE: "Sun 12262010- 00416.22mysqldmp.rar"
KEEP  : "Sun 12192010-160542.20mysqldmp.rar"
DELETE: "Sun 12192010- 80616.52mysqldmp.rar"
DELETE: "Sun 12192010- 00416.45mysqldmp.rar"
KEEP  : "Sun 12122010-160541.05mysqldmp.rar"
DELETE: "Sun 12122010- 80612.63mysqldmp.rar"
DELETE: "Sun 12122010- 00413.69mysqldmp.rar"
KEEP  : "Sun 12052010-160514.45mysqldmp.rar"
DELETE: "Sun 12052010- 80612.00mysqldmp.rar"
DELETE: "Sun 12052010- 00418.94mysqldmp.rar"
KEEP  : "Sun 11282010-160507.91mysqldmp.rar"
DELETE: "Sun 11282010- 80610.70mysqldmp.rar"
DELETE: "Sun 11282010- 00418.44mysqldmp.rar"
KEEP  : "Sun 11212010-160509.03mysqldmp.rar"
DELETE: "Sun 11212010- 80606.49mysqldmp.rar"
DELETE: "Sun 11212010- 00404.25mysqldmp.rar"
KEEP  : "Sun 11142010-160500.38mysqldmp.rar"
DELETE: "Sun 11142010- 80611.64mysqldmp.rar"
DELETE: "Sun 11142010- 00406.32mysqldmp.rar"
KEEP  : "Sun 11072010-160541.74mysqldmp.rar"
DELETE: "Sun 11072010- 80558.93mysqldmp.rar"
DELETE: "Sun 11072010- 00359.70mysqldmp.rar"
KEEP  : "Sun 10312010-160517.97mysqldmp.rar"
DELETE: "Sun 10312010- 80557.49mysqldmp.rar"
DELETE: "Sun 10312010- 00359.10mysqldmp.rar"
KEEP  : "Sun 10242010-160508.27mysqldmp.rar"
DELETE: "Sun 10242010- 80552.24mysqldmp.rar"
DELETE: "Sun 10242010- 00354.21mysqldmp.rar"
KEEP  : "Sun 10172010-160503.77mysqldmp.rar"
DELETE: "Sun 10172010- 80554.89mysqldmp.rar"
DELETE: "Sun 10172010- 00400.87mysqldmp.rar"
KEEP  : "Sun 10102010-160521.37mysqldmp.rar"
DELETE: "Sun 10102010- 80559.58mysqldmp.rar"
DELETE: "Sun 10102010- 00353.06mysqldmp.rar"
KEEP  : "Sun 10032010-160517.27mysqldmp.rar"
DELETE: "Sun 10032010- 80551.34mysqldmp.rar"
DELETE: "Sun 10032010- 00351.77mysqldmp.rar"
KEEP  : "Sun 09262010-160508.64mysqldmp.rar"
DELETE: "Sun 09262010- 80559.01mysqldmp.rar"
DELETE: "Sun 09262010- 00350.20mysqldmp.rar"
KEEP  : "Sun 09192010-160457.08mysqldmp.rar"
DELETE: "Sun 09192010- 80545.43mysqldmp.rar"
DELETE: "Sun 09192010- 00345.52mysqldmp.rar"
KEEP  : "Sun 09122010-160457.01mysqldmp.rar"
DELETE: "Sun 09122010- 80547.20mysqldmp.rar"
DELETE: "Sun 09122010- 00343.40mysqldmp.rar"
KEEP  : "Sun 09052010-160452.16mysqldmp.rar"
DELETE: "Sun 09052010- 80537.61mysqldmp.rar"
DELETE: "Sun 09052010- 00332.16mysqldmp.rar"
KEEP  : "Sun 08292010-160456.74mysqldmp.rar"
DELETE: "Sun 08292010- 80536.06mysqldmp.rar"
DELETE: "Sun 08292010- 00340.01mysqldmp.rar"
KEEP  : "Sun 08222010-160447.98mysqldmp.rar"
DELETE: "Sun 08222010- 80536.75mysqldmp.rar"
DELETE: "Sun 08222010- 00335.64mysqldmp.rar"
KEEP  : "Sun 08152010-160450.83mysqldmp.rar"
DELETE: "Sun 08152010- 80526.09mysqldmp.rar"
DELETE: "Sun 08152010- 00331.70mysqldmp.rar"
KEEP  : "Sun 08082010-160435.00mysqldmp.rar"
DELETE: "Sun 08082010- 80529.77mysqldmp.rar"
DELETE: "Sun 08082010- 00331.12mysqldmp.rar"
KEEP  : "Sun 07252010-232543.25mysqldmp.rar"
DELETE: "Sun 07252010-134804.39mysqldmp.rar"
DELETE: "Sun 07252010- 83841.33mysqldmp.rar"
KEEP  : "Sun 02202011-160641.91mysqldmp.rar"
DELETE: "Sun 02202011- 80643.42mysqldmp.rar"
DELETE: "Sun 02202011- 00438.06mysqldmp.rar"
KEEP  : "Sun 02132011-160557.05mysqldmp.rar"
DELETE: "Sun 02132011- 80635.69mysqldmp.rar"
DELETE: "Sun 02132011- 00435.58mysqldmp.rar"
KEEP  : "Sun 02062011-160555.94mysqldmp.rar"
DELETE: "Sun 02062011- 80633.86mysqldmp.rar"
DELETE: "Sun 02062011- 00434.34mysqldmp.rar"
KEEP  : "Sun 01302011-160544.32mysqldmp.rar"
DELETE: "Sun 01302011- 80636.77mysqldmp.rar"
DELETE: "Sun 01302011- 00435.07mysqldmp.rar"
KEEP  : "Sun 01232011-160611.56mysqldmp.rar"
DELETE: "Sun 01232011- 80626.06mysqldmp.rar"
DELETE: "Sun 01232011- 00452.64mysqldmp.rar"
KEEP  : "Sun 01162011-160558.59mysqldmp.rar"
DELETE: "Sun 01162011- 80628.09mysqldmp.rar"
DELETE: "Sun 01162011- 00423.92mysqldmp.rar"
KEEP  : "Sun 01092011-160537.50mysqldmp.rar"
DELETE: "Sun 01092011- 80624.22mysqldmp.rar"
DELETE: "Sun 01092011- 00423.99mysqldmp.rar"
KEEP  : "Sun 01022011-160535.64mysqldmp.rar"
DELETE: "Sun 01022011- 80623.47mysqldmp.rar"
DELETE: "Sun 01022011- 00421.20mysqldmp.rar"
KEEP  : "Sat 12252010-160531.07mysqldmp.rar"
DELETE: "Sat 12252010- 80617.22mysqldmp.rar"
DELETE: "Sat 12252010- 00420.42mysqldmp.rar"
KEEP  : "Sat 12182010-160520.59mysqldmp.rar"
DELETE: "Sat 12182010- 80610.61mysqldmp.rar"
DELETE: "Sat 12182010- 00414.17mysqldmp.rar"
KEEP  : "Sat 12112010-160514.49mysqldmp.rar"
DELETE: "Sat 12112010- 80614.28mysqldmp.rar"
DELETE: "Sat 12112010- 00411.24mysqldmp.rar"
KEEP  : "Sat 12042010-160508.76mysqldmp.rar"
DELETE: "Sat 12042010- 80610.97mysqldmp.rar"
DELETE: "Sat 12042010- 00418.84mysqldmp.rar"
KEEP  : "Sat 11272010-160511.56mysqldmp.rar"
DELETE: "Sat 11272010- 80610.35mysqldmp.rar"
DELETE: "Sat 11272010- 00412.06mysqldmp.rar"
KEEP  : "Sat 11202010-160506.05mysqldmp.rar"
DELETE: "Sat 11202010- 80606.90mysqldmp.rar"
DELETE: "Sat 11202010- 00404.06mysqldmp.rar"
KEEP  : "Sat 11132010-160502.45mysqldmp.rar"
DELETE: "Sat 11132010- 80601.52mysqldmp.rar"
DELETE: "Sat 11132010- 00400.61mysqldmp.rar"
KEEP  : "Sat 11062010-160524.03mysqldmp.rar"
DELETE: "Sat 11062010- 80607.28mysqldmp.rar"
DELETE: "Sat 11062010- 00357.62mysqldmp.rar"
KEEP  : "Sat 10302010-160521.92mysqldmp.rar"
DELETE: "Sat 10302010- 80601.67mysqldmp.rar"
DELETE: "Sat 10302010- 00356.47mysqldmp.rar"
KEEP  : "Sat 10232010-160521.72mysqldmp.rar"
DELETE: "Sat 10232010- 80611.79mysqldmp.rar"
DELETE: "Sat 10232010- 00356.36mysqldmp.rar"
KEEP  : "Sat 10162010-160513.99mysqldmp.rar"
DELETE: "Sat 10162010- 80611.81mysqldmp.rar"
DELETE: "Sat 10162010- 00354.68mysqldmp.rar"
KEEP  : "Sat 10092010-160518.86mysqldmp.rar"
DELETE: "Sat 10092010- 80549.01mysqldmp.rar"
DELETE: "Sat 10092010- 00354.34mysqldmp.rar"
KEEP  : "Sat 10022010-160518.61mysqldmp.rar"
DELETE: "Sat 10022010- 80556.80mysqldmp.rar"
DELETE: "Sat 10022010- 00348.25mysqldmp.rar"
KEEP  : "Sat 09252010-160508.13mysqldmp.rar"
DELETE: "Sat 09252010- 80552.72mysqldmp.rar"
DELETE: "Sat 09252010- 00348.74mysqldmp.rar"
KEEP  : "Sat 09182010-160505.77mysqldmp.rar"
DELETE: "Sat 09182010- 80545.68mysqldmp.rar"
DELETE: "Sat 09182010- 00344.63mysqldmp.rar"
KEEP  : "Sat 09112010-160458.37mysqldmp.rar"
DELETE: "Sat 09112010- 80550.67mysqldmp.rar"
DELETE: "Sat 09112010- 00345.45mysqldmp.rar"
KEEP  : "Sat 09042010-160456.96mysqldmp.rar"
DELETE: "Sat 09042010- 80537.60mysqldmp.rar"
DELETE: "Sat 09042010- 00341.04mysqldmp.rar"
KEEP  : "Sat 08282010-160449.79mysqldmp.rar"
DELETE: "Sat 08282010- 80535.87mysqldmp.rar"
DELETE: "Sat 08282010- 00337.78mysqldmp.rar"
KEEP  : "Sat 08212010-160458.67mysqldmp.rar"
DELETE: "Sat 08212010- 80536.72mysqldmp.rar"
DELETE: "Sat 08212010- 00335.02mysqldmp.rar"
KEEP  : "Sat 08142010-160443.57mysqldmp.rar"
DELETE: "Sat 08142010- 80529.82mysqldmp.rar"
DELETE: "Sat 08142010- 00328.40mysqldmp.rar"
KEEP  : "Sat 08072010-160430.09mysqldmp.rar"
DELETE: "Sat 08072010- 80533.81mysqldmp.rar"
DELETE: "Sat 08072010- 00330.66mysqldmp.rar"
KEEP  : "Sat 02192011-160601.69mysqldmp.rar"
DELETE: "Sat 02192011- 80638.19mysqldmp.rar"
DELETE: "Sat 02192011- 00443.60mysqldmp.rar"
KEEP  : "Sat 02122011-160616.76mysqldmp.rar"
DELETE: "Sat 02122011- 80654.22mysqldmp.rar"
DELETE: "Sat 02122011- 00540.70mysqldmp.rar"
KEEP  : "Sat 02052011-160609.64mysqldmp.rar"
DELETE: "Sat 02052011- 80639.80mysqldmp.rar"
DELETE: "Sat 02052011- 00432.74mysqldmp.rar"
KEEP  : "Sat 01292011-160549.50mysqldmp.rar"
DELETE: "Sat 01292011- 80635.64mysqldmp.rar"
DELETE: "Sat 01292011- 00432.06mysqldmp.rar"
KEEP  : "Sat 01222011-160549.28mysqldmp.rar"
DELETE: "Sat 01222011- 80628.94mysqldmp.rar"
DELETE: "Sat 01222011- 00427.92mysqldmp.rar"
KEEP  : "Sat 01152011-160537.93mysqldmp.rar"
DELETE: "Sat 01152011- 80623.71mysqldmp.rar"
DELETE: "Sat 01152011- 00427.47mysqldmp.rar"
KEEP  : "Sat 01082011-160556.50mysqldmp.rar"
DELETE: "Sat 01082011- 80625.41mysqldmp.rar"
DELETE: "Sat 01082011- 00418.76mysqldmp.rar"
KEEP  : "Sat 01012011-160546.21mysqldmp.rar"
DELETE: "Sat 01012011- 80618.59mysqldmp.rar"
DELETE: "Sat 01012011- 00431.10mysqldmp.rar"
KEEP  : "Mon 12272010-160543.70mysqldmp.rar"
DELETE: "Mon 12272010- 80616.53mysqldmp.rar"
DELETE: "Mon 12272010- 00416.68mysqldmp.rar"
KEEP  : "Mon 12202010-160529.13mysqldmp.rar"
DELETE: "Mon 12202010- 80615.99mysqldmp.rar"
DELETE: "Mon 12202010- 00412.30mysqldmp.rar"
KEEP  : "Mon 12132010-160505.43mysqldmp.rar"
DELETE: "Mon 12132010- 80612.29mysqldmp.rar"
DELETE: "Mon 12132010- 00412.88mysqldmp.rar"
KEEP  : "Mon 12062010-160526.19mysqldmp.rar"
DELETE: "Mon 12062010- 80612.29mysqldmp.rar"
DELETE: "Mon 12062010- 00413.58mysqldmp.rar"
KEEP  : "Mon 11292010-160511.69mysqldmp.rar"
DELETE: "Mon 11292010- 80613.86mysqldmp.rar"
DELETE: "Mon 11292010- 00409.74mysqldmp.rar"
KEEP  : "Mon 11222010-160507.79mysqldmp.rar"
DELETE: "Mon 11222010- 80606.89mysqldmp.rar"
DELETE: "Mon 11222010- 00407.33mysqldmp.rar"
KEEP  : "Mon 11152010-160502.71mysqldmp.rar"
DELETE: "Mon 11152010- 80656.81mysqldmp.rar"
DELETE: "Mon 11152010- 00401.57mysqldmp.rar"
KEEP  : "Mon 11082010-160522.16mysqldmp.rar"
DELETE: "Mon 11082010- 80559.95mysqldmp.rar"
DELETE: "Mon 11082010- 00359.79mysqldmp.rar"
KEEP  : "Mon 11012010-160524.19mysqldmp.rar"
DELETE: "Mon 11012010- 80558.16mysqldmp.rar"
DELETE: "Mon 11012010- 00357.82mysqldmp.rar"
KEEP  : "Mon 10252010-160505.23mysqldmp.rar"
DELETE: "Mon 10252010- 80550.22mysqldmp.rar"
DELETE: "Mon 10252010- 00350.58mysqldmp.rar"
KEEP  : "Mon 10182010-160516.31mysqldmp.rar"
DELETE: "Mon 10182010- 80601.07mysqldmp.rar"
DELETE: "Mon 10182010- 00355.81mysqldmp.rar"
KEEP  : "Mon 10112010-160512.64mysqldmp.rar"
DELETE: "Mon 10112010- 80552.63mysqldmp.rar"
DELETE: "Mon 10112010- 00354.57mysqldmp.rar"
KEEP  : "Mon 10042010-160510.94mysqldmp.rar"
DELETE: "Mon 10042010- 80553.86mysqldmp.rar"
DELETE: "Mon 10042010- 00356.75mysqldmp.rar"
KEEP  : "Mon 09272010-160512.85mysqldmp.rar"
DELETE: "Mon 09272010- 80601.34mysqldmp.rar"
DELETE: "Mon 09272010- 00347.90mysqldmp.rar"
KEEP  : "Mon 09202010-160509.03mysqldmp.rar"
DELETE: "Mon 09202010- 80546.48mysqldmp.rar"
DELETE: "Mon 09202010- 00347.35mysqldmp.rar"
KEEP  : "Mon 09132010-160502.72mysqldmp.rar"
DELETE: "Mon 09132010- 80545.55mysqldmp.rar"
DELETE: "Mon 09132010- 00348.63mysqldmp.rar"
KEEP  : "Mon 09062010-160457.71mysqldmp.rar"
DELETE: "Mon 09062010- 80539.61mysqldmp.rar"
DELETE: "Mon 09062010- 00339.57mysqldmp.rar"
KEEP  : "Mon 08302010-160506.70mysqldmp.rar"
DELETE: "Mon 08302010- 80538.58mysqldmp.rar"
DELETE: "Mon 08302010- 00337.95mysqldmp.rar"
KEEP  : "Mon 08232010-160454.97mysqldmp.rar"
DELETE: "Mon 08232010- 80534.70mysqldmp.rar"
DELETE: "Mon 08232010- 00333.90mysqldmp.rar"
KEEP  : "Mon 08162010-160443.32mysqldmp.rar"
DELETE: "Mon 08162010- 80526.67mysqldmp.rar"
DELETE: "Mon 08162010- 00336.69mysqldmp.rar"
KEEP  : "Mon 08092010-160433.34mysqldmp.rar"
DELETE: "Mon 08092010- 80530.96mysqldmp.rar"
DELETE: "Mon 08092010- 00331.64mysqldmp.rar"
KEEP  : "Mon 08022010-160431.39mysqldmp.rar"
DELETE: "Mon 08022010- 80527.73mysqldmp.rar"
DELETE: "Mon 08022010- 00329.79mysqldmp.rar"
KEEP  : "Mon 07262010-232225.05mysqldmp.rar"
DELETE: "Mon 07262010-112802.91mysqldmp.rar"
DELETE: "Mon 07262010- 80423.39mysqldmp.rar"
KEEP  : "Mon 02212011- 80638.81mysqldmp.rar"
DELETE: "Mon 02212011- 00437.57mysqldmp.rar"
KEEP  : "Mon 02142011-160557.48mysqldmp.rar"
DELETE: "Mon 02142011- 80628.94mysqldmp.rar"
DELETE: "Mon 02142011- 00437.43mysqldmp.rar"
KEEP  : "Mon 02072011-160546.30mysqldmp.rar"
DELETE: "Mon 02072011- 80635.18mysqldmp.rar"
DELETE: "Mon 02072011- 00438.65mysqldmp.rar"
KEEP  : "Mon 01312011-160554.72mysqldmp.rar"
DELETE: "Mon 01312011-140555.20mysqldmp.rar"
DELETE: "Mon 01312011- 80631.80mysqldmp.rar"
DELETE: "Mon 01312011- 00428.52mysqldmp.rar"
KEEP  : "Mon 01242011-160554.33mysqldmp.rar"
DELETE: "Mon 01242011- 80626.77mysqldmp.rar"
DELETE: "Mon 01242011- 00426.79mysqldmp.rar"
KEEP  : "Mon 01172011-160551.10mysqldmp.rar"
DELETE: "Mon 01172011- 80625.79mysqldmp.rar"
DELETE: "Mon 01172011- 00439.11mysqldmp.rar"
KEEP  : "Mon 01102011-160540.72mysqldmp.rar"
DELETE: "Mon 01102011- 80620.51mysqldmp.rar"
DELETE: "Mon 01102011- 00418.24mysqldmp.rar"
KEEP  : "Mon 01032011-160545.34mysqldmp.rar"
DELETE: "Mon 01032011- 80633.65mysqldmp.rar"
DELETE: "Mon 01032011- 00422.50mysqldmp.rar"
KEEP  : "Fri 12312010-160557.90mysqldmp.rar"
DELETE: "Fri 12312010- 80633.06mysqldmp.rar"
DELETE: "Fri 12312010- 00425.87mysqldmp.rar"
KEEP  : "Fri 12242010-160536.65mysqldmp.rar"
DELETE: "Fri 12242010- 80616.75mysqldmp.rar"
DELETE: "Fri 12242010- 00416.09mysqldmp.rar"
KEEP  : "Fri 12172010-160548.74mysqldmp.rar"
DELETE: "Fri 12172010- 80614.74mysqldmp.rar"
DELETE: "Fri 12172010- 00413.68mysqldmp.rar"
KEEP  : "Fri 12102010-160519.90mysqldmp.rar"
DELETE: "Fri 12102010- 80610.36mysqldmp.rar"
DELETE: "Fri 12102010- 00413.48mysqldmp.rar"
KEEP  : "Fri 12032010-160510.84mysqldmp.rar"
DELETE: "Fri 12032010- 80607.80mysqldmp.rar"
DELETE: "Fri 12032010- 00408.25mysqldmp.rar"
KEEP  : "Fri 11262010-160509.82mysqldmp.rar"
DELETE: "Fri 11262010- 80609.64mysqldmp.rar"
DELETE: "Fri 11262010- 00405.99mysqldmp.rar"
KEEP  : "Fri 11192010-160503.89mysqldmp.rar"
DELETE: "Fri 11192010- 80603.56mysqldmp.rar"
DELETE: "Fri 11192010- 00405.56mysqldmp.rar"
KEEP  : "Fri 11122010-160502.75mysqldmp.rar"
DELETE: "Fri 11122010- 80559.01mysqldmp.rar"
DELETE: "Fri 11122010- 00404.98mysqldmp.rar"
KEEP  : "Fri 11052010-160537.92mysqldmp.rar"
DELETE: "Fri 11052010- 80557.72mysqldmp.rar"
DELETE: "Fri 11052010- 00412.88mysqldmp.rar"
KEEP  : "Fri 10292010-160515.48mysqldmp.rar"
DELETE: "Fri 10292010- 80556.54mysqldmp.rar"
DELETE: "Fri 10292010- 00356.58mysqldmp.rar"
KEEP  : "Fri 10222010-160520.77mysqldmp.rar"
DELETE: "Fri 10222010- 80555.54mysqldmp.rar"
DELETE: "Fri 10222010- 00353.73mysqldmp.rar"
KEEP  : "Fri 10152010-160517.50mysqldmp.rar"
DELETE: "Fri 10152010- 80552.91mysqldmp.rar"
DELETE: "Fri 10152010- 00413.00mysqldmp.rar"
KEEP  : "Fri 10082010-160550.29mysqldmp.rar"
DELETE: "Fri 10082010- 80550.69mysqldmp.rar"
DELETE: "Fri 10082010- 00355.53mysqldmp.rar"
KEEP  : "Fri 10012010-160519.64mysqldmp.rar"
DELETE: "Fri 10012010- 80604.07mysqldmp.rar"
DELETE: "Fri 10012010- 00344.63mysqldmp.rar"
KEEP  : "Fri 09242010-160502.04mysqldmp.rar"
DELETE: "Fri 09242010- 80554.01mysqldmp.rar"
DELETE: "Fri 09242010- 00350.16mysqldmp.rar"
KEEP  : "Fri 09172010-160504.00mysqldmp.rar"
DELETE: "Fri 09172010- 80542.25mysqldmp.rar"
DELETE: "Fri 09172010- 00348.99mysqldmp.rar"
KEEP  : "Fri 09102010-160500.05mysqldmp.rar"
DELETE: "Fri 09102010- 80544.88mysqldmp.rar"
DELETE: "Fri 09102010- 00339.40mysqldmp.rar"
KEEP  : "Fri 09032010-160457.21mysqldmp.rar"
DELETE: "Fri 09032010- 80539.56mysqldmp.rar"
DELETE: "Fri 09032010- 00339.12mysqldmp.rar"
KEEP  : "Fri 08272010-160457.77mysqldmp.rar"
DELETE: "Fri 08272010- 80541.13mysqldmp.rar"
DELETE: "Fri 08272010- 00342.50mysqldmp.rar"
KEEP  : "Fri 08202010-160502.63mysqldmp.rar"
DELETE: "Fri 08202010- 80531.57mysqldmp.rar"
DELETE: "Fri 08202010- 00332.96mysqldmp.rar"
KEEP  : "Fri 08132010-160426.34mysqldmp.rar"
DELETE: "Fri 08132010- 80529.25mysqldmp.rar"
DELETE: "Fri 08132010- 00328.15mysqldmp.rar"
KEEP  : "Fri 08062010-160436.69mysqldmp.rar"
DELETE: "Fri 08062010- 80527.42mysqldmp.rar"
DELETE: "Fri 08062010- 00337.35mysqldmp.rar"
KEEP  : "Fri 02182011-160552.60mysqldmp.rar"
DELETE: "Fri 02182011- 80639.59mysqldmp.rar"
DELETE: "Fri 02182011- 00434.32mysqldmp.rar"
KEEP  : "Fri 02112011-160543.27mysqldmp.rar"
DELETE: "Fri 02112011- 80631.90mysqldmp.rar"
DELETE: "Fri 02112011- 00435.52mysqldmp.rar"
KEEP  : "Fri 02042011-160603.57mysqldmp.rar"
DELETE: "Fri 02042011- 80638.31mysqldmp.rar"
DELETE: "Fri 02042011- 00447.89mysqldmp.rar"
KEEP  : "Fri 01282011-160553.41mysqldmp.rar"
DELETE: "Fri 01282011- 80628.09mysqldmp.rar"
DELETE: "Fri 01282011- 00433.83mysqldmp.rar"
KEEP  : "Fri 01212011-160558.30mysqldmp.rar"
DELETE: "Fri 01212011- 80629.76mysqldmp.rar"
DELETE: "Fri 01212011- 00443.01mysqldmp.rar"
KEEP  : "Fri 01142011-160538.21mysqldmp.rar"
DELETE: "Fri 01142011- 80625.92mysqldmp.rar"
DELETE: "Fri 01142011- 00421.93mysqldmp.rar"
KEEP  : "Fri 01072011-160552.65mysqldmp.rar"
DELETE: "Fri 01072011- 80621.82mysqldmp.rar"
DELETE: "Fri 01072011- 00421.75mysqldmp.rar"

Open in new window

0
 
LVL 9

Author Comment

by:blakogre
Comment Utility
Sorry: I thought I pasted some output into the window: note near the end where it appears to be deleting single files, and throughout, where "the system cannot find the file specified".

I like the pause/more idea.

Note which portion of the code can be removed once I verify the code repeatedly deletes the write files.

I'll try and test your new code shortly, it may resolve some of these issues.

My initial run's report  below (partial)

DELETE: "Fri 01142011- 00421.93mysqldmp.rar"
The system cannot find the file specified.
KEEP  : "Fri 01072011-160552.65mysqldmp.rar"
DELETE: "Fri 01072011- 80621.82mysqldmp.rar"
The system cannot find the file specified.
DELETE: "Fri 01072011- 00421.75mysqldmp.rar"
The system cannot find the file specified.
KEEP  : "WEB2 D Drive.live.dreams.rar"
DELETE: "WEB2 C Drive.live.dreams.rar"
The system cannot find the file specified.
DELETE: "WEB1 C Drive.live.dreams.rar"
The system cannot find the file specified.
DELETE: "TS1 C DRIVE.live.dreams.rar"
The system cannot find the file specified.
DELETE: "MAIL1 C Drive.live.dreams.rar"
The system cannot find the file specified.
DELETE: "DB E Drive.rar"
The system cannot find the file specified.
DELETE: "DB D Drive.rar"
The system cannot find the file specified.
0
 
LVL 51

Expert Comment

by:Bill Prew
Comment Utility
I think post #35011966 should handle the posted question, but I was waiting to hear back from the OP.  The only possible issue may be running the BAT file from a different folder, and that could be easily addressed with a PUSHD.  

~bp
0
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
LVL 9

Author Comment

by:blakogre
Comment Utility
Will test today and let you know, sorry about that.  sidetracked.
0
 
LVL 9

Author Comment

by:blakogre
Comment Utility
Sample output below.

by "Unexpected output" -- I'm referring to "The system cannot find the file specified"

I'd be more comfortable knowing the source of the msg and eliminating it.
DELETE: "Mon 01312011-140555.20mysqldmp.rar"
The system cannot find the file specified.
DELETE: "Mon 01312011- 80631.80mysqldmp.rar"
The system cannot find the file specified.
DELETE: "Mon 01312011- 00428.52mysqldmp.rar"
The system cannot find the file specified.
KEEP  : "Mon 01242011-160554.33mysqldmp.rar"
DELETE: "Mon 01242011- 80626.77mysqldmp.rar"
The system cannot find the file specified.
DELETE: "Mon 01242011- 00426.79mysqldmp.rar"
The system cannot find the file specified.
KEEP  : "Mon 01172011-160551.10mysqldmp.rar"
DELETE: "Mon 01172011- 80625.79mysqldmp.rar"
The system cannot find the file specified.
DELETE: "Mon 01172011- 00439.11mysqldmp.rar"
The system cannot find the file specified.
KEEP  : "Mon 01102011-160540.72mysqldmp.rar"
DELETE: "Mon 01102011- 80620.51mysqldmp.rar"
The system cannot find the file specified.
DELETE: "Mon 01102011- 00418.24mysqldmp.rar"
The system cannot find the file specified.
KEEP  : "Mon 01032011-160545.34mysqldmp.rar"
DELETE: "Mon 01032011- 80633.65mysqldmp.rar"
The system cannot find the file specified.
DELETE: "Mon 01032011- 00422.50mysqldmp.rar"
The system cannot find the file specified.
KEEP  : "Fri 12312010-160557.90mysqldmp.rar"
DELETE: "Fri 12312010- 80633.06mysqldmp.rar"
The system cannot find the file specified.
DELETE: "Fri 12312010- 00425.87mysqldmp.rar"
The system cannot find the file specified.
KEEP  : "Fri 12242010-160536.65mysqldmp.rar"
DELETE: "Fri 12242010- 80616.75mysqldmp.rar"
The system cannot find the file specified.
DELETE: "Fri 12242010- 00416.09mysqldmp.rar"
The system cannot find the file specified.
KEEP  : "Fri 12172010-160548.74mysqldmp.rar"
DELETE: "Fri 12172010- 80614.74mysqldmp.rar"
The system cannot find the file specified.
DELETE: "Fri 12172010- 00413.68mysqldmp.rar"
The system cannot find the file specified.

Open in new window

0
 
LVL 51

Expert Comment

by:Bill Prew
Comment Utility
Okay, looks like you are not running the script from the base directory, so we can allow for that with this change:

@echo off
setlocal EnableDelayedExpansion

REM Define location of backup files, and create a work folder for delete candidates
set BaseDir=N:\SP
set DelDir=%BaseDir%\delete
if not exist "%DelDir%" md "%DelDir%"

pushd "%BaseDir%"

REM Process all files in base folder, keepin the most recent one
set Last=
for /F "tokens=*" %%A in ('dir /b /a-d "%BaseDir%\??? ????????-??????.??mysqldmp.rar" ^| sort /R') do (
  for /F "tokens=1 delims=-" %%B in ("%%~nA") do (
    if "%%B" EQU "!Last!" (
      echo DELETE: "%%A"
      move "%%A" "%DelDir%" >NUL
    ) else (
      echo KEEP  : "%%A"
      set Last=%%B
    )
  )
)

REM Confirm delete, or move files back if no confirmation
echo.
set /P "Confirm=Confirm delete of these files? (Y/N): "
if "%Confirm%" EQU "Y" (
  del /Q "%DelDir%"
) else (
  move "%DelDir%\*.*" "%BaseDir%" >NUL
)

popd

Open in new window

~bp
0
 
LVL 9

Author Comment

by:blakogre
Comment Utility
Ah -- ok, moved it to basedir.  Either is fine.  Though I tend to keep all scheduled batch files in one location, so thanks for the tweak.  Output is as expected, except for a "More" statement for larger amounts of files, and identification of the code which can be rem'd to just delete without prompt, once enough runs occur and I'm comfortable with output.

thanks
0
 
LVL 51

Assisted Solution

by:Bill Prew
Bill Prew earned 500 total points
Comment Utility
If you really want to do the delete's straight away with no confirmation then it couls shrink down to this:

@echo off
setlocal EnableDelayedExpansion

REM Define location of backup files, and create a work folder for delete candidates
set BaseDir=N:\SP
pushd "%BaseDir%"

REM Process all files in base folder, keepin the most recent one
set Last=
for /F "tokens=*" %%A in ('dir /b /a-d "%BaseDir%\??? ????????-??????.??mysqldmp.rar" ^| sort /R') do (
  for /F "tokens=1 delims=-" %%B in ("%%~nA") do (
    if "%%~B" EQU "!Last!" (
      del /Q "%%~A"
    )
  )
)

popd

Open in new window

~bp
0
 
LVL 9

Author Comment

by:blakogre
Comment Utility
Is the more still doable?  or, only process X # of dir entries at a time?  Something that allows me to do larger directories as needed...

thanks
0
 
LVL 51

Expert Comment

by:Bill Prew
Comment Utility
Sorry, don't think I understood the MORE thing originally, but I think I do now.  So you want to be able to scroll one screen at a time the audit display of deleted and kept files?  I think that could be done, yes.

~bp
0
 
LVL 9

Author Comment

by:blakogre
Comment Utility
When I run it on a full directory of files -- I cannot review them all, because it scrolls past the buffer/history and the initials keep/delete annotated files are gone/scrolled off the list....

So, I can't accurately choose to keep or delete due to that.  Any workable solution you come up with should be fine:   |more: or even parsing 25 lines at a time, then acting, then the next 25, etc... whatever's easiest to code.
0
 
LVL 51

Accepted Solution

by:
Bill Prew earned 500 total points
Comment Utility
Give this approach a try.

@echo off
setlocal EnableDelayedExpansion

REM Define location of backup files, and create a work folder for delete candidates
set BaseDir=x:\ee\EE26842813
REM set BaseDir=N:\SP
set DelDir=%BaseDir%\delete
if not exist "%DelDir%" md "%DelDir%"

pushd "%BaseDir%"

REM Process all files in base folder, keepin the most recent one
set Last=
(for /F "tokens=*" %%A in ('dir /b /a-d "%BaseDir%\??? ????????-??????.??mysqldmp.rar" ^| sort /R') do (
  for /F "tokens=1 delims=-" %%B in ("%%~nA") do (
    if "%%B" EQU "!Last!" (
      echo DELETE: "%%A"
      move "%%A" "%DelDir%" >NUL
    ) else (
      echo KEEP  : "%%A"
      set Last=%%B
    )
  )
))>_temp_.txt

more _temp_.txt

REM Confirm delete, or move files back if no confirmation
echo.
set /P "Confirm=Confirm delete of these files? (Y/N): "
if "%Confirm%" EQU "Y" (
  del /Q "%DelDir%"
) else (
  move "%DelDir%\*.*" "%BaseDir%" >NUL
)

del _temp_.txt>NUL
popd

Open in new window

~bp
0
 
LVL 9

Author Comment

by:blakogre
Comment Utility
More works.  However, I attempted to actually then, delete files, and it appears nothing got deleted.  Every subsequent run shows the same files to delete, and file count in the folder remains the same...
0
 
LVL 9

Author Comment

by:blakogre
Comment Utility
Nevermind.  The Y is case sensitive. :-)
0
 
LVL 51

Expert Comment

by:Bill Prew
Comment Utility
You can make the Y not case sensitive by changing:

if "%Confirm%" EQU "Y" (


to:

if /I "%Confirm%" EQU "Y" (


~bp
0
 
LVL 9

Author Comment

by:blakogre
Comment Utility
Ok, it seems to be working great -- thank you very much.  I'll use the last one for large directories, and I can use the previous for straight deletes without confirmation.  I think that covers it.  Thanks :-)
0
 
LVL 9

Author Closing Comment

by:blakogre
Comment Utility
Thanks so much for your assistance once again. :-)
0
 
LVL 51

Expert Comment

by:Bill Prew
Comment Utility
@blakogre

Glad I was able to help and get you something useful, thanks for the kind words.

~bp
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

The following is a collection of cases for strange behaviour when using advanced techniques in DOS batch files. You should have some basic experience in batch "programming", as I'm assuming some knowledge and not further explain the basics. For some…
VALIDATING DATES One method of validating dates is to jam the date into the DATE command and see if it accepts it by examining the system's errorlevel value. A non-zero result indicates failure. A typical example might look something like the fol…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

763 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

9 Experts available now in Live!

Get 1:1 Help Now