![]()
[<<]Message[>>] [<<]Author[>>] [<<]Subject[>>] [<<]Thread[>>]
Number : 3238 Date : 2002-12-12 Author : Garry Deane Subject : Re: Preserving Generation Backups Size(KB) : 1
--- In xxcopy@yahoogroups.com, "freedom41ca " wrote: > The bottom line is that generation back-ups allow you to: > > 1. create a timestamped record of your changes/modifications > 2. should a change ever not work out, you can quickly revert back to a previous change by going back one generation of your work, or two, or three until you get to a point before the problem was created. > 3. who's to say that your one and only back-up was not corrupted during the backup process. I'm not sure whether xxcopy could handle this (it probably can) but it's quite straightforward to do with a bit of batch code. I'll assume that you are using NT or higher and that your backups have a structure like the following: d:\backups\ ..\20021128\ ..\20021129\ ..\20021130\ ..\20021201\ etc. That is, the generational backups are named with ISO date stamps. If not, you could modify the following to be ordered using the creation date instead of the name which should be just as effective. Your aim is to keep the 10 directories with the most recent dates and delete the others. If you use "DIR d:\backups /o-n/b/ad" this will list the directories in reverse name order. It's then simply a matter of deleting the 11th, 12th etc directories. @echo off :: Remove echo {test} below when satisfied that it works as required for /f "skip=10" %%a in ('dir d:\backup /o-n/b/ad') do ( echo {test} rd %%a /s /q ) If you are using W98/ME or similar, I'd suggest using a utility like LMOD (http://home.mnet-online.de/horst.muc/) to achieve a similar result, albeit with the use of a few temporary files. Garry
This message if part of XXCOPY's message Archive. The archive contains all the messages posted at Yahoo!Groups: XXCOPY.