Summary ------- If want to cleanup .BAK files which are scattered across your disk drives, moveBAK is the tool for you. moveBAK can list, move, or remove .BAK files. With the move action, .BAK files are moved into a common directory, and renamed based on the original date of the file. (A version number is also added to avoid files overwriting each other in the common directory.) Requirements ------------ Windows 95/98/NT. This is a 32-bit DOS command, but can be run directly from a Windows short-cut. Installation ------------ Use your favorite "zip utility" to unzip the files into any directory of your choice. (If this file is incomplete, see complete version, moveBAK.txt, found in moveBAK.zip for more information.) The moveBAK.zip can be found at: http://world.std.com/~wren/notetab/moveBAK.zip The initial configuration file only lists .BAK files on drive C, it does not move or delete any files. Recommendation: Use a configuration which only lists your .BAK files, or run with the "-n" option, until you are sure no .BAK files will be moved or deleted by mistake. Files ----- moveBAK.exe Needs to be in a directory in your search path only if run from DOS. moveBAK.ini Configuration file which specifies the drives or directories to be searched. Should usually be in the same directory as moveBAK.exe moveBAK.txt This description. moveBAK.out Default output file. moveBAK.ini (configuration) file -------------------------------- 1. This file determines which drives, and or directories are searched for .BAK files. 2. Blank lines, and comment lines beginning with # symbols are ignored. 3. If you want to specify the output file, the first non-comment line should be an output line which specifies the output file. Example: output: c:\temp\BAKmoves.txt 4. If no output line is specified, the output file will be named moveBAK.out and placed in the same directory as this .ini file. 5. Next follow sets of lines for each drive or directory to be searched. Each set of lines must have: a) search: followed by the starting point for the search, b) skip: (optional) followed by 1-10 strings, and c) an action, either: list, delete, or moveto 6. The moveto action must be followed by the directory where the files are to be moved. The directory must be on the same drive as the search path. 7. Files in this directory are renamed based on the date. For example, readme.BAK might be named readme-980731.001 where 980731 is the date the .BAK file was last modified. If additional readme.BAK files are put in the same directory (either from other original directories, or from other times moveBAK is run) they would have version numbers like 002, 003, etc. 8. All path musts be complete (include the drive specification.) In each set, the search and moveto drives must match. 9. If any string in the skip specification appears in a directory path, that directory and all its sub-directories are skipped. There is a limit of 10 skip strings per search. If a string contains blanks, quote it. 10. The colons following the keywords are optional. .ini file examples ------------------ 1) To move all .BAK files (drive C only) to a temporary directory: search: c:\ skip: \RECYCLE \temp\ moveto: c:\temp\BAK 2) To move .BAK files under "My Documents" to a temporary directory and to delete all other .BAK files on two drives: output: c:\temp\_moveBAK.txt # (Put output in directory, instead of .ini directory) search: "c:\My Documents" # (Note that you must quote paths which contain spaces.) moveto: c:\temp\BAK search: c:\ skip: \RECYCLE \temp\ delete search: d:\ skip: \RECYCLE delete Command line options -------------------- -n.BAK. Do not include files with .BAK. inside the name (may be overridden by .BAK. action, see Notes below.) -n.BAK Do not include files with .BAK extension (may be overridden by .BAK action, see Notes below.) -n Do nothing, do not really move or delete files. -v Verbose, list all files moved or deleted in the output file. -q Quietly, do not list directories or statistics. -Q Very quietly, output only errors. INI-FILE Allows specification of .ini file on command line. (Default: moveBAK.ini either in the directory where moveBAK is started, or in the directory where moveBAK.exe was found.) -o FILE Allows specification of output file on command line (instead of in the .ini file, default: moveBAK.out) Legal ----- The author of this program accepts no responsibility for damages resulting from its use and makes no warranty or representation, either express or implied, including but not limited to, any implied warranty of merchantability or fitness for a particular purpose. This software is provided "AS IS", and you, its user, assume all risks when using it. The program and accompanying files are copyrighted material. No part of this material may be distributed with other software packages without the express permission from the author. NOTES ----- 1. The skip strings are case sensitive. The paths are not (assuming the directory already exists.) 2. When running as a short-cut under NT you will not see any error messages if the output file cannot be opened. Solution: run under DOS until you correct .ini problems. 3. If you rename moveBAK.exe, the other file names must/will change to match. 4. It's possible you may find that time stamps are off by some number of hours. If you find the time stamps in the output file are off by X minutes, add a line like the following in your .ini file (it must be the first non-comment line): tzdiff +X or tzdiff -X Failure to make this adjustment may result in the wrong date on moved files with a modified time near midnight. (You might also want to verify the date stamp on moved files with a modified time near midnight -- both with and without the tzdiff adjustment.) If you need to do this let the author know what setting for tzdiff you had to use, the time zone settings on your machine, and if there is a TZ variable set in your environment what its value is. 5. Files with names like abc.BAK.txt are also included by default. (These files are created by the "move->.BAK.ext" clip. Files with names like abc.BAK are create by NoteTab when the "Backup use .BAK" option is checked.) You can control which directories .BAK. or .BAK files are included by placing actions like: .BAK. include or .BAK. exclude or .BAK include or .BAK exclude at appropriate places relative to the search actions in the .ini file.