Hi, I have a folder I wish to only keep 2 days backups in, basically last
nights and the day before. Anything older then delete, is this possible?

Re: Scheduale delete of files based on date? by Herb

Herb
Wed May 07 00:57:26 PDT 2008


"Cyborg" <apollo13@btinternet.com> wrote in message
news:8469B316-EFA0-42E9-B88A-91536FB3F058@microsoft.com...
> Hi, I have a folder I wish to only keep 2 days backups in, basically last
> nights and the day before. Anything older then delete, is this possible?

Yes, but it is harder than it sounds with ONLY built-in tools.

Google (group) search the microsoft.public.cmdprompt.admin or similar
groups for solutions.

Also consider acquiring a purpose built tool for doing it (or at least
selecting the files).

Perl and over non-batch scripting can make such tasks trivial too.



Re: Scheduale delete of files based on date? by Pegasus

Pegasus
Wed May 07 01:13:47 PDT 2008


"Cyborg" <apollo13@btinternet.com> wrote in message
news:8469B316-EFA0-42E9-B88A-91536FB3F058@microsoft.com...
> Hi, I have a folder I wish to only keep 2 days backups in, basically last
> nights and the day before. Anything older then delete, is this possible?

You could use xxcopy.exe. It's downloadable from a number
of sites.
@echo off
set cutoff=2
set folder=d:\My Data
c:\tools\xxcopy.exe /rs /db#%cutoff% /yy "%Folder%"

Try the batch file on a test directory before moving on
to the real thing.