CPNEW - Copy new files to backup (Rainbow or IBM PC) cpnew [-abcfiprv] source,source,... target Sources are directory names or file specifications; source specifications may contain a drive and/or a directory path and wildcard characters. The target is either a directory name or a disk drive letter followed by a colon. For each file matched by the first argument, CPNEW looks in the directory or drive specified by the second argument for a file of the same name. If no such file exists, or if it exists but has an older date than the source file, the source file is copied to the target location. If the target is "2:", drives A and B are treated as one big drive; matching files are searched for first on A, then on B. when a new file is created, CPNEW first tries to put it on A; if the file won't fit on A it is put on B. If a source filespec contains a drive and/or directory, these are passed along to the subsequent source filespecs until reassigned; thus cpnew \src\*.c,*.obj,\exe\*.* b: is the same as cpnew \src\*.c,\src\*.obj,\exe\*.* b: and cpnew b:bob,carol,\tmp\ted,alice \bed is shorthand for cpnew b:bob,b:carol,b:\tmp\ted,b:\tmp\alice \bed If there is not enough room on the target disk for the copy, the program pauses while the user changes disks; the file checking then continues. Options: -a (attributes) Causes the target file to inherit the attributes (read-only, hidden, etc.) of the source file. Normally the target file is created read/write, non-hidden, non-system, with the archive bit clear (e.g. not backed up). -b (incremental backup) Implies -cfp (see below). If the target is omitted, 2: is assumed. -c (changed) Consider only those files whose archive bit is set (i.e. that have been changed since the last real BACKUP). -f (flag) Flag the source file, i.e. turn off the archive bit. -i (input) The list of files to copy is taken from the standard input rather than the command line. Thus with -i the format of cp is cpnew -i [-cfprv] target This is useful when using cp as a filter. e.g. ls -fm | cp -i a: copies files in order from smallest to largest. This insures that the most files will be copied to a: before it fills. -p (path) The target must be a drive letter followed by a colon. If a directory (path) specification is present for a source file, it will be copied to a path of that name on the target drive. Directories are created on the target drive as needed. The command cpnew -p \exe\*.*,\src\*.* a: will copy files to directories a:\exe and a:\src ls -rdf \ | cpnew -ip B: will backup up all of the current drive onto floppies on B -r (replace) Replace only (don't create), i.e. don't copy unless an older version of the file already exists on the target. -v (verify) Causes user confirmation to be requested before copying. At each file prompt the user answers either Y (do the copy), ! (do the copy and don't ask for confirmation on future files), or N (don't copy this file). Any other answer is the same as N. Thanks to Glen C. Siegel, whose program KOPYNEW was the inspiration for CPNEW. Copyright (c) 1985,86,87, Bryan Higgins. The author may be reached/rewarded at 1802 Channing Way Berkeley, CA 94703 One of the Kramden Utilities.