Archive old data

  • Thread starter Thread starter Mark
  • Start date Start date
M

Mark

One of our data servers is very full, so I would like to
be able to archive off the oldest data files. Is there
any utils/scripts that can search the drive and put in
date order when the files where created.

THanks

Mark
 
Mark said:
One of our data servers is very full, so I would like to
be able to archive off the oldest data files. Is there
any utils/scripts that can search the drive and put in
date order when the files where created.

THanks

Mark

DIR /?
 
Phil said:
Yes that works off course

dir /S /OD

but i assume he would like the sorting to take place not only
in the directorybounds.

And piping the output to sort doesn't help because you then loose the
directory. And using dir /B has directory but no date.

So Dir doesn't help.

Matthias
 
One of our data servers is very full, so I would like to
be able to archive off the oldest data files. Is there
any utils/scripts that can search the drive and put in
date order when the files where created.

The following 4NT command will produce a list containing the fully
qualified names of all files in all subdirectories below the current
directory, preceded by each file's creation date:

FOR /A:-D /R . %fn IN (*.*) ECHO %@FILEDATE["%fn",c,4] - %fn

FOR and @FILEDATE[] are documented at <http://jpsoft.com/help/for.htm>
and <http://jpsoft.com/help/f_filedate.htm>, respectively.

I would however warn against taking files off-line simply based on their
creation date as that is an insufficient indicator of actual usage. So
is the last access date, even if that is not disabled.
 
Mark wrote in
One of our data servers is very full, so I would like to
be able to archive off the oldest data files. Is there
any utils/scripts that can search the drive and put in
date order when the files where created.

Possibly forfiles.exe redirected to file for FQPaths of files meeting a
date spec. I don't see how to sort them though
 
Mark said:
Mark wrote in



Possibly forfiles.exe redirected to file for FQPaths of files meeting a
date spec. I don't see how to sort them though

forfiles -s -pc:\ -m*.* -c"cmd /c echo @FDATE @PATH\@FILE" | sort > mylist.txt
 
Matthias said:
Phil Robyn schrieb:



Yes that works off course

dir /S /OD

but i assume he would like the sorting to take place not only
in the directorybounds.

And piping the output to sort doesn't help because you then loose the
directory. And using dir /B has directory but no date.

So Dir doesn't help.

Matthias

Hi, Matthias,

Of course, you are right: DIR all by itself will not suffice. But
it is not difficult to use DIR as the basis of an approach that
would do what the original poster requires. (Note: it is probably
not necessary to search the entire drive, only a subset of the drive's
directories). Personally, I would use FORFILES.EXE (free download
from Microsoft) and the 'SORT' command or perhaps a third-party sort
utility like Horst Schaeffer's SORTXL from http://home.mnet-online.de/horst.muc/
 
-----Original Message-----
Phil Robyn wrote in news:[email protected]:

Bingo. I forgot about @FDATE (duh)

.
Thanks for the help. Could you tell me where to download
the forfiles program. I have done a search but hasnt
pulled anything back.

THanks

Mark
 
Back
Top