Have you ever needed to move only certain files out of a directory, based on their last modified date? Or have you wanted to move all the files out of a given directory, except for the latest three? If so, then you've finally got a utility to do just that (a not much else)!
AnalogX NewMove is about as straight-forward as any command line utility ever is; from the command prompt you can type the name by itself to get a list of options:
AnalogX NewMove version 1.01 (Release)
The latest version can always be found at http://www.analogx.com/
Usage: NEWMOVE [options]
Options: /TARGET [path] Destination for files
/SOURCE [path] Source for files (def: current)
/COUNT [number] Number of files to leave (def: 1)
/JUSTCOPY Copies the files (does not move)
/MOVEOLD Move older files first (default)
/MOVENEW Move newer files first
/DELETE Don't move or copy, just delete
/TEST Nothing actually changes
Here's a brief description of each option:
TARGET This is the path where you want the files to be copied to. It
supports both relative (..\) paths or literal paths (C:\). I
would recommend using literal whenever possible to eliminate
any possible ambiguity, unless you are comfortable with using
SOURCE This is the directory it is going to be working in. If no
source directory is specified, then it will use the current
COUNT This is the number of files to actually leave, so if you told
it to move newer files first, with a count of 5, it would leave
the five OLDEST files. In contrast, if it was set to move the
older files first, it would leave the five NEWEST files.
JUSTCOPY Use the COPY command instead of MOVE, leaving the source files
intact where they are. By default the program uses MOVE.
MOVEOLD This specifies the order in which files are copied; the
directory is sorted with the older files first, and it copies
from older moving towards newer.
MOVENEW Exactly the same as MOVEOLD, except the files are sorted with
newer files first, and it copies from newer moving towards
DELETE Instead of actually copying or moving files, the program will
TEST If you're unsure of how things will happen, you can always
specify test, and it will report everything it would have
normally done, but without actually doing any of it.
Pretty simple, eh? So here is a quick example of one of the more common uses of this utility.
Let's say you have a directory which stores log files for something like IIS (set to create a new file each day), and you perform analysis using Analog of the last week (7 days) of activity. Now, you don't want Analog to process the log files for anything prior to 7 days (sure, you can set this in Analog's config file, but it still reads through the log files, which takes time). Here's the command to tell it to move anything that's older than 7 days:
NEWMOVE /TARGET C:\logs\archive /COUNT 7 /MOVEOLD
This assumes it's executed in the directory where the logs exist, it then reads the directory, sorts it with the older files first, and moves all but 7 files into the directory C:\logs\archive.