PURPOSE OPERATION OPTIONS COMMAND LINES RELATED PROGRAMS
This program comes in both 16 and 32 bit versions. As of 2003, the 16 bit versions are no longer being supported, updated or maintained.
The upcopy program is designed to read a source and destination directory and copy only newer files from the source to destination. UPCOPY operates similar to xcopy or robocopy except with better e-discovery/forensic options.
A second use is to provide the program a list of files to copy to a new destination. This option (-S) is especially useful when doing some sort of update and you have a known list of files that need to be copied, and a destination root path for all of them to go to. Those using the Hashkeeper program will find this especially useful.
Generally it should be used to copy (update) files from one directory to another. An excellent use is to update certain files from a hard disk to a floppy or visa versa.
It can be used to copy files only newer than certain number of days old, or all newer files regardless of age. It can be set to only copy those files that already exist, thus not adding superfluous files to the destination.
As of Nov. 2007 there are two new options/capabilities. One cabaility is to provide a list of top level folders/paths (--dirs=filename) from which to copy source files. This allows the user to specify specific folders (ie: \documents and setting, \other_folders) and not traverse the entire file system.
The other option added Nov. 2007, is to provide a list (--bypass=filename) of top level folders which are to be BYPASSED. So you would start at the top of the root, but bypass \docs and settings and bypass \windows, and others.
In Feb. 2008 the logging options have been changed significantly (--logfile, --error, .ini). The -2, -3 logging options are no longer available after Feb 2008. All logging options have been replaced. However, the -1 (one) logging option still creates a basic log file, but without lists of filenames checked, copied or passed.
During the copy process the file dates and times of the original file are maintained in the destination file attributes. However, without the -R (Reset) option, the original access time is adjusted accordingly.
Source file type(s) (i.e. *.c) if necessary are provided by the user. The default is to copy all files (*.*)
The program locates all files in the source directory meeting the file specifications. If no source file types are provided, *.* is assumed. Source file types can contain wildcards, multiple file specs, or be blank for all (*.*) A source directory must be specified, but source file types defaults to (*.*).
If the source file list (-S) is used, then the Source files are taken to be all the files listed in the provided list. This list is a text file containing one filename (including full path) per line.
When the program starts, the destination drive or directory is examined. If using the default of all files, the destination is searched for a file of similar name. If one is found, the parameters (options selected) are compared from the source file against the destination file. If the destination needs to be updated, it is. I.e. when the same file is found on the destination as in the source directory, and the destination file is older than the source file, the newer source file is copied to the destination.
If there is no destination file of the correct name, then the source file is copied to the destination. (-e overrides this operation to copy ONLY existing files).
The destination MUST be a directory or drive. If it is only a drive (-d A:) All subdirectories under the source are copied to appropriately created subdirectories on the destination.
Note:
If you are using only a drive as destination, make certain the default directory on that drive is the top level directory to start writing to. I.e. if the default on A: was A: \tmp, when the operation started, then all the copying would begin at A:\tmp and continue to create subdirectories below. If you wanted to start at A:\, then the default directory on A: should be root.
There is no check to see if the destination file is read-only. Destination Read-only files are NOT written over. (To force an overwrite of protected destination files, use the -O option. The -O option is not documented on the programs help screen.)
Various options exist to allow the user to “program” the file selection process, by file name, size, age, whether the destination exists or not and other options.
The 32-bit version will copy long file name files, and any file that meets the traditional long filename parameters.
The copy list option (-S) is ONLY available in the 32-bit version.
During the copy process the file dates and times of the original file are maintained in the destination file attributes. However, without the -R (Reset) option, the original access time is adjusted accordingly.
Copy Errors - ERROR FILE, updated/changed 2/2008
In some instances, especially when processing files using the -S (source list) option, you may find that there are some files that are NOT COPIED. In most instances this is because the file name has been generated by a program that writes UNICODE file names into a traditional text file. Thus loosing a significant amount of filename characters. These files are most often found in the internet cache area, and are usually .url type files. In most cases, they are of no consequence. However, they cannot be copied, because the text file which the program is reading as sources, does not contain the true unicode filename, and thus cannot find the file.
In any case, there are files which cannot be copied. Sometimes, it is purely a windows permission problem, which the user must overcome.
The purpose of the -E error file (replaced Feb 2008, by the --error=16 option), is to provide the user with a list of files which were not copied, and provide the user with information which may be useful in performing some other manual review or copy process. In cases where it is merely a system permission problem, once the permissions have been properly set, the files can be copied. For this reason, if the -E option is chosen, another file with the same root name as the error file, and has an extension of .lst. This file, has as its format, one that can be passed to the -S option, once the problem has been solved, and another recovery run is needed. In effect, this new file, has a clean listing of all those not copied.
C:>upcopy [source_directory] [destination_directory] [-[options]]
VERY IMPORTANT NOTE: The program can be run with only the source and destination directory on the command line (upcopy a: d:) without using any options. However, IF the destination is used without an option, the source item on the command line must also be present. This is because the source and destination (without options) are positionally specific on the command line. This means the source MUST occur before the destination. However the reverse is not true. You can list the source without an option, and pick up with the -d and other options. This capability of running without options is for quick operation (and for lazy people like myself).
C:>upcopy C:\tmp D:\tmp\old
/* copy the tree structure from C:\tmp to a new directory D:\tmp\old */
C:>upcopy -p C:\tmp -d d:\tmp\old
/* same as the first one, except this one makes use of the options */
C:>upcopy -p c:\tmp -d d:\tmp\old -f *.doc
/* copy only the *.doc files*/
C:>upcopy -p c:\tmp -d d:\tmp\old -f *.doc *.ppt
/* copy *.doc and *.ppt files */
C:>upcopy -p c:\tmp -d d:\tmp\old --logfile=c:\path\logfilename!63
/* 2008: create ALL available logfiles named logfilename, in path
C:>upcopy -d d:\work_dir -S listfile.nam
/* copy all the files identified in the text file listfile.nam to the d:\work_dir tree */
The latest versions, (after 6/2007) have enhanced option usage. The options can also now be literal words preceded by the double -- (minus) signs. This syntax is similar to the *IX formats. The enhanced options are not included here. You should check the help screen of the program to see any particular option which has this format implemented. an example would be: instead of the -d path\folder, you could use: --destination=path\folder, or instead of the -S fileoption, you could use: --list=file_containing_list_to_copy.
Format NOTE When an option is listed of the following format: -option + filename: the plus sign (+) is indicated to mean that you must include an item following the option. DO NOT INCLUDE the plus (+) in the command line.
-p + src_dir: Use this directory as the source (starting point). Generally the format is: (-p C:\TOP_LEVEL_FOLDER\ANY_SUBFOLDERS). The source directory can be a network designation (i.e. \\COMPUTER_NAME\C\FOLDER_NAME). Not used if the -S option is used. (-p and -S are mutually exclusive)
-S + filename: Text file (filename) containing a list, one per line, of source files to copy to the destination directory. (The names in the file MUST be filenames and not merely directories. If the source file can't be found, the program continues with the next.) The destination directory ( -d d:\option) is the top level tree where all the files will be copied. The copy maintains tree structure below the destination directory. Hashkeeper users find this very useful. . (-p and -S are mutually exclusive).
The line of text containing the filename MUST be pipe ( | ) delimited if the line of text contains more information than just the filename, see samples below. (i.e. if it is the output of diskcat which also contains file size etc.). The filename MUST be left justified, without leading spaces and be the first item on the line.
If the text files contain only the filename, (which is the preferred format), then there is no need for the pipe delimeters.
This file format:
C:\anydir\anyfile
C:\another_dir\another_file
C:\as_many_files\as_are_necessary
Or:
F:\anydir\another\dir\filename.ext | 123456 | 09-12-2002 12:26AM
C:\anydir\anyfile | 123 | 08-12-2002 09:25AM C:\another_dir\another_file | 12387 | 04-12-2002 09:25AM C:\as_many_files\as_are_necessary | 122344 | 02-12-2002 09:25AM
-d + dest_dir: Use this as the destination directory. This is the top level destination path. Generally the format is: (-d D:\TOP_LEVEL_DEST_FOLDER\ANY_SUBFOLDERS). All files will be created under this destination, and original path will be maintained below this destination. The destination directory can be a network designation (i.e. \\COMPUTER_NAME\C\FOLDER_NAME) However, tests should be conducted to see if the destination paths are properly created.
-f + filetype(s): Copy only those files meeting this file type. Additional file type can be added by separating each one by a space. (i.e. -f *.c *.doc *.tmp *.ppt ). This option is overridden by -S.
-m: Automatically make the first destination if it does not exist. Without this option, if the first (top level) destination directory doesn’t exist, the user is prompted for an OK to create it. All subsequent subdirectories are automatically created without user intervention. Use this in batch file operation so no user input is needed.
-M: Same as -m, except the final destination directory will maintain the date and time of the source directory.
-h: Perform hash of both source and destination file. This confirms a good copy.
-hs: Perform hash on ONLY the source file. (this option can only be used with the -H outputfile option).
-hd: Perform hash on ONLY the destination file. (this option can only be used with the -H outputfile option).
Note: the -hs and -hd options are mutually exclusive, and are only useful when outputting hashes to an output file. If they are used without the -H option, results are unpredictable.
-H + hashfile: Perform hash of both source and destination file, and record results in the file named by hashfile. This can almost serve as a replacement for the -2 logfile option. This confirms a good copy.
-nN: Print only a name listing of the files that would be copied. DO NOT perform the copy operation. The (-N) upper case version also prints the file size for information and calculation purposes. The output of the -n can be studied to confirm the correct files will be copied and also passed to a program like rm or rmd to remove the files once the copy process has taken place.
-r: DO NOT recurs through the source directory for file. The default is that the source directory is recursed and ALL subsequent files and directories are copied. The default operation emulates the XCOPY command.
-i Proceed Immediately with the copy. Without this option the source tree is first scanned and files are counted so the user knows how many files are involved.
-A Copy (overwrite) ALL files. This causes all the files in the source tree to be copied. If this option is not used, only newer files, and ones that don’t exist in the destination are copied. This option causes a clean sweep of the tree. Consider adding the -O option to ensure overwrite of protected files.
-e Only copy over existing files. If the destination file doesn’t it won’t be created. Without this option, all newer and files where the destination doesn’t exist are copied. Possible use is, suppose the destination only has *.doc files in the tree, but the source has *.docs, some of which DON”T already exist on the destination. If the -f *.doc option is used, ALL the doc files would be used, use this if only the existing files are to be overwritten.
-E + errorfilename "Replaced 2/2008": Create an error file which holds information regarding files not copied. This file contains a listing of all files not copied to the destination. Some reasons the file could not be copied are that the destination disk is full or the destination file is locked by the OS (ie NT locks certain files, such as system files, and they can't be accessed while locked).
-O Force and overwrite of any file that is protected, such as read only files. This has no effect on OS locked files. It has only been shown to be effective with files with the read only or hidden attribute set. This option is not documented on the program help screen.
-g + #:
-l + #: Copy only those files (g)reater than or (l)ess than # days old. Replace the # with a valid number of days.
-g + mm-dd-yyyy[acw]
-l + mm-dd-yyyy[acw]: (that's and ell, not a one). Process only those files (g)reater (older) than or (l)ess than (newer) than this mm-dd-yyyy date. The date MUST be in the form mm-dd-yyyy. It MUST have two digit month and days (leading 0 IS required),
and it MUST have a 4 digit year.
The date given mm-dd-yyyy is NOT included in the calculation.
Ie. if today was 01-10-2003 and you entered -l 01-09-2003 you would only process todays files. If you wanted to include those on 01-09, you should have entered -l 01-08-2003.
if any of the acw items are included, restrict the date to that type. (access, create, write)
-t[acw]: In the 32 bit version, this is used to modify the -g or -l option to specify which time type to use in the calculations. The a==access, c==create, w==last write time. Don’t forget, in WIN9X, there is no access time.
-G + #:
-L + #: Copy only those files (G)reater than or (L)ess than # bytes in size. Replace the # with a valid file size.
-R: Because the files are opened and read, on WINNT and WIN9X the access date is modified. This option attempts to reset the source file date back to its original.
During the copy process the file dates and times of the original file are maintained in the destination file attributes. However, without the -R (Reset) option, the original access time is adjusted accordingly..
-1 logfile Create an output logfile with statistical information relating to the programs operation.
-2 and -3 options discontinued as of Feb 2008 version
-2 logfile DISCONTINUED: see -1 below
Create an output log file with statistical information.
This file is more verbose than that used in the -1 logfile option, and contains a
list, in 2 line format, of all the source files their destination. This file can get quite
large depending on the number of files copied.
-3 logfile DISCONTINUED: see -1 below
Create an output log file with statistical information.
This file is more verbose than that used in the -1 logfile option, and contains a
list, in single line format, of all the source files their destination. This file can get
quite large depending on the number of files copied.
As of Feb 2008 there are 3 new ways to get logfile creations.
BIG NOTE: When obtaining the statistics from any of the logging options, DON'T try and reconcile the number of files processed, copied, errored off, etc. More often than not, the numbers will NOT reconcile. This is because of the internal matrix that is arrived at to process the file, and the location in the logic process that a number is added to any one of the logging values. For instance, there may be 100 files processed, and some may meet or fail certain logic tests the user has requested. Depending on which ones fail and meet the logic tests they may ultimately be copied or not. However, they may be counted or not depending on the test they met or failed to meet. SO DON'T expect a clean reconcilation.
-1 + logfilename[[!;|]xx]: filename to create logging file(s).
this '!' '|' or ';' seperator can be any one of the three but only 1
the [xx] syntax == any value below added together to get matrix of files
logging files that may be created are:
1: default logfile: contains command line, and statistics
2: list logfile: contains list of ALL files scanned for copy
4: copied logfile: contains list of ALL files successfully copied
8: not_copied logfile: contains list of files scanned but not copied
this file contains files not meeting criteria PLUS copy errors
16: error logfile: contains files meeting criteria, but had COPY error
32: renamed dupes log: destination file renamed due to duplicate
For ALL logfiles use: \"logfilename!63\" or greater. Normal is !31
Alternate -- option to the -1 logfile
--logfile=logfilename[!|;]xx Replace !xx with similar value as -1 option OR
--logfile=logfilename[!|;][list,copy,not,dupe,error] comma seperated file types
list==listfile==2, copy==copied file==4 not==notcopied==8
error==errorfile==16, dupes==duperenamefile==32
--error=xx replace xx with a value above. no filename allowed
\nTHE '! ; or |' seperator is required between filename and matrix value
any items or options values are always OR'd together
example: --logfile=logname.ext!2 --err=12
results in list, copied and notcopied logs + default logfile
upcopy.ini file syntax: [LOGFILE=name[ [[!|;] [bitmask] keyword,keyword..]]]
[LOGS=keyword,keyword...]
--dirs=filename Filename is a text file containing the full top level
path of the folder(s) you wish to copy. No error checking is performed to see if the
folders exist or not. If it exists, the files below are copied in the normal fashion.
The file is a text file, with one path/folder per line, (or pipe delimeted, see help screen).
This option is mutually exclusive
with the -S option. So don't use them together. Sample
f:\documents and settings\johns folder
f:\documents and settings\other folder | other stuff on the line
f:\program files\virus generators
--bypass=filename Filename is a text file containing the full top level
path of the folder(s) of folders you wish to bypass. No error checking is performed to see if the
folders exist or not. If it exists, it will be bypassed and no files below will be copied.
The file is a text file, with one path/folder per line.
If the "filename" is not a file containing paths, but the actual path, it is treated as such.
This --bypass= option can be included multiple times on the command line. Once for each folder,
and/or for the file. This option is mutually exclusive with the -S option. So don't use them together. Sample
f:\documents and settings\johns folder bypass
f:\documents and settings\other folder bypass
f:\program files\virus checkers bypass
If you have an upcopy.ini file, the ini file contents are
bypass=f:\foldername
bypass=f:\anotherfoldername
bypass=etc.
Here are samples of the two types of output formats.
-2 Logfile_Option
512 |D:\DRa00632\DRa00632\AAA00632|
==>D:\NEWDIR\DRa00632\DRa00632\\AAA00632|
512 |D:\DRa00632\DRa00632\AAA00635|
==>D:\NEWDIR\DRa00632\DRa00632\AAA00635|
-3 Logfile_Option
512 |D:\DRa00632\AAA00632| ==>D:\NEWDIR\DRa00632\AAA00632|
512 |D:\DRa00632\AAB00632| ==>D:\NEWDIR\DRa00632\AAB00632|
DOS Copy
XCOPY
XCOPY32
top