## Using Your DDK

[prev][next][parent][TOC]

### File Synchronization Utility (NSYNC)

Tool Description:

NSYNC is used to copy, move, or pack files that have later date/time stamps , or different sizes and contents, from source to target directories. It also can be used to compare dates, times, and sizes of files in source and target directories. If dates, times, and sizes are the same, the contents of the files can be compared by selecting an optional switch. Some of the features include the following:

Can use only one action at a time
Can delete files in a given directory or a tree
Can make a multi-level directory
Supports meta search characters
Can specify options anywhere in any order

If Ctrl-C or Ctrl-Break is pressed during execution, the operation on the current file will be completed before the interrupt is honored.

    The syntax for NSYNC is as follows:

       NSYNC [d:]source-path
                  [d:][target-path]
                  [*.h !a*b?.c] [{-|/|+}option(s)]
         or

       NSYNC @[pathlist] [{-|/|+}option(s)]

    where:

       d: is the drive letter.
       source-path is the name of the source directory (null if the action is
              delete or -i).
       target-path is the name of the target directory.
       pathlist is a listing of fully qualified filenames that need to be
              manipulated. This parameter cannot contain any wildcard characters.

Available options are described below:

Action Options:

-i Deletes files in a directory or a tree.
-m Moves files from source to target directories or trees.
-q Hardmoves files (workaround for LS HPFS 386).
-n Does NOT copy, move, or pack. Only compares dates, times, and sizes of files.
-k Makes a multiple level directory path.

Action Modifiers:

-a Zaps target attribute during execution.
-b If source and target have same dates but different sizes, doesn't process.
-d Deletes extra target files during execution.
-g Does not display any warning messages.
-j Deletes or moves files in tree. Does NOT remove directories.
-o Copies or moves older source files.
+o Ignores disk full error. Keeps going.
-p Prompts user before any action is taken.
-x Processes only if target file exists.
+x Processes only if target file does NOT exist.
-w Retains SOURCE attributes during execution.
+w Retains TARGET attributes during execution.
-u PACKs source files before copying or moving them to target.
+u[fname] Writes PACKed filenames to a file (NSYNC.PCK).
-y If dates, times, and sizes are alike, compares contents of files.
+y If sizes are alike, compares contents of files-ignores date/time stamps.
-z Zaps extra target files AND directories during execution (-d).

Display Options:

-f Uses full pathnames in output.
-v Displays verbose results of action taken.
-l[fname] Writes results into a file (NSYNC.LST).

Search Options:

-h Processes hidden and system files.
-r Recursively processes all files and directories.
-t If target directories do not exist during execution, creates them.
!*.exe Excludes all files with extensions of 'EXE' from the search.

Examples:

nsync temp1 temp2 Copies all files having later date and time stamps from temp1 to temp2.

nsync d:temp1 . /fvl Copies all newer files from d:temp1 to currently working directory. Uses full path names when displayed, logs the results to NSYNC.LST, and displays verbose results of action taken.

nsync -k temp1/temp2/temp3/temp4/temp5 Makes a multiple level directory path.

nsync temp2 /hai Deletes all files, including hidden, system, and read-only , in directory temp2.

nsync temp1 /rm temp2 ?sy*.e?e Moves all files that match the meta search specified from tree temp1 to temp2.

nsync temp2 /irjv Deletes all files in tree temp2, does not remove subdirs, and displays verbose results of action taken.

nsync d:\ m:\backup -aglc:\backup.txt -oz +w Copies all newer files from d: \ to m:\backup, clears target attributes, does not display any warning messages, logs results to c:\backup.txt, copies older source files as well, deletes all extra target files and directories, and resets target attributes to their original values after finishing copying.

nsync . temp? /irvp Deletes all files or directories that match the meta search temp? in the currently working directory.

nsync /f temp1 -d temp2 /g +x Copies all newer files from temp1 to temp2, displays full path names, deletes all extra target files, does not display any warning messages, and copies only if target file exists.

nsync temp1 temp2 *.h *.c /v Copies a subset of files from temp1 to temp2 and displays verbose results of action taken.

nsync temp1 temp2 *.h !*.obj *.c !*.exe temptest? /fr Copies a subset of files AND directories from temp1 to temp2 and uses full pathnames when displayed.

nsync @list.lst ~@@~usa~ Copies all files specified in the list, replaces " @@" with "usa" if it is found in the file names.

nsync @list.lst /pag ~$~exe~ ~123~obj~ PACKs all files specified in the list before copying or moving, clears target file attributes, does not display any warning messages, and replaces "$" with "exe" and "123" with " obj" if found in the file names.

nsync @delete.lst /i Deletes files, excluding hidden, system, and read-only , specified in the list.

Sample input list file entries:

c:\config.sys d:\config.sys
c:\work\sep19.rpt d:\work\sep19.rpt

Files Provided in DDK:

         Directory:  \DDK\TOOLS

         o  NSYNC.EXE