			Selective Back-up   v 0.0.1


   Selective Back-Up is a flexible tool for creating and maintaining exact copy
of a whole drive (partition) or desired files/directories/paths.

   By default two files are considered as different if they has any diffence in:
- name;
- size;
- date or time of last write;
- attributes;
- EA size.

   Attributes to be compared are selectable. Additionaly EA's content comparison
is available.

   All command-line arguments, config parameters and values are case insensitive.
If arguments or values includes a space(s) ' ' or a semicolon(s) ';' remember to
quote it by '"'.


		1. Command-line arguments.
		--------------------------

   Note that command-line arguments override any parameters specified in a
config-file. All arguments are optional and can be specified in any order. Use
'sbu.exe -?' for command-line arguments list.

-cfg		<filename>
-log		<filename>
-LogLvl		<level>
-LogNew
-ScrLvl		<level>
-drv		<letter>
-scan
-sync
-all


-cfg <filename>
  Default value: 'sbu.cfg'.
  Optional argument.
  Configuration file name. If not specified then 'sbu.cfg' searched in the
  directory where program resides.
 
-log <filename>
  Default value: 'sbu.log'.
  Optional argument.
  Log-file name. If not specified then 'sbu.log' searched or created in the
  directory where program resides.

-LogLvl <level>
  Default value: 4.
  Optional argument.
  Level of actions and events to be logged.
  level 0: disable logging.
  level 1: start, end, statistics, fatal errors.
  level 2: level 1 + warnings, erros.
  level 3: level 2 + pass number, PathSrc, PathDst.
  level 4: level 3 + pass statistics.
  level 7: debug.
  level 8: more debug.
  level 9: more debug.

-LogNew
  Default value: append.
  Optional argument.
  Replace log-file, append by default.

-ScrLvl <level>
  Default value: 4.
  Optional argument.
  Level of actions and events to be output to screen.
  level 0: start, fatal errors.
  level 1: level 0 + end, statistics.
  level 2: level 1 + warnings, erros.
  level 3: level 2 + pass number, PathSrc, PathDst.
  level 4: level 3 + pass statistics.
  level 7: debug.
  level 8: more debug.
  level 9: more debug.

-drv <letter>
  Optional argument.
  Letter for drive name substitution instead of '?' specified in a config-file.
  Useful when drive letter is unpredictable (removable drive).

-scan
  Optional argument.
  Scanning only, no changes.

-sync
  Optional argument.
  Synchronize content of PathDst with PathSrc. Kill all directories and files
  which are present in a PathDst but are absent in a PathSrc (exept of specified
  Skip* paths, dirs and files). This allows to maintain exact path's content
  copy. Source remain untouched, acting destination only.

-all
  Optional argument.
  Doesn't check file differences, copy all (exept of specified Skip* paths, dirs
  and files). If CopyFile specified then only that files are copied.


		2. Configuration file.
		----------------------

   The only required parameters are PathSrc and PathDst, any other ones are optional.

		2.1 Configuration file structure.
		---------------------------------

	Common parameters (optional):

LogName		<filename>		; default is 'sbu.log'
LogNew		<y (yes) or n (no)>	; default is No (append)
LogLvl		<level>			; default is 4
ScrLvl		<level>			; default is 4
ErrExit		<number>		; default is 0 (never)

	Default parameters (optional):

Sync		<y (yes) or n (no)>	; default is No
SubDir		<y (yes) or n (no)>	; default is Yes
SupEA		<y (yes) or n (no)>	; default is autodetect
CmpFileEA	<y (yes) or n (no)>	; default is No
CmpDirEA	<y (yes) or n (no)>	; default is No
UseArchive	<y (yes) or n (no)>	; default is No
CmpAttrMask	<hex mask>		; default is 27
CmpAttrReadonly	<y (yes) or n (no)>	; default is Yes
CmpAttrHidden	<y (yes) or n (no)>	; default is Yes
CmpAttrSystem	<y (yes) or n (no)>	; default is Yes
CmpAttrArchive	<y (yes) or n (no)>	; default is Yes

	Pass #1 parameters:

PathSrc		<source path #1>		; required parameter
CopyFile	<file1> [file2 file3 ...]	; optional parameter
SkipSrcFile 	<file1> [file2 file3 ...]	; optional parameter
SkipSrcDir 	<dir1> [dir2 dir3 ...]		; optional parameter
SkipSrcPath 	<path1> [path2 path3 ...]	; optional parameter
SkipDstFile 	<file1> [file2 file3 ...]	; optional parameter
SkipDstDir 	<dir1> [dir2 dir3 ...]		; optional parameter
SkipDstPath 	<path1> [path2 path3 ...]	; optional parameter
Sync		<y (yes) or n (no)>		; optional parameter
SubDir		<y (yes) or n (no)>		; optional parameter
SupEA		<y (yes) or n (no)>		; optional parameter
CmpFileEA	<y (yes) or n (no)>		; optional parameter
CmpDirEA	<y (yes) or n (no)>		; optional parameter
UseArchive	<y (yes) or n (no)>		; optional parameter
CmpAttrMask	<hex mask>			; optional parameter
CmpAttrReadonly	<y (yes) or n (no)>		; optional parameter
CmpAttrHidden	<y (yes) or n (no)>		; optional parameter
CmpAttrSystem	<y (yes) or n (no)>		; optional parameter
CmpAttrArchive	<y (yes) or n (no)>		; optional parameter
PathDst		<destination path #1>		; required parameter

	[...]

	Pass #N parameters:

PathSrc		<source path #N>
[...]
PathDst		<destination path #N>


		2.2 Common parameters.
		----------------------

   Next parameters can be specified in any order before the first pass (the
first PathSrc keyword).

LogName		<filename>		; default is 'sbu.log'
LogNew		<y (yes) or n (no)>	; default is No (append)
LogLvl		<level>			; default is 4
ScrLvl		<level>			; default is 4
ErrExit		<number>		; default is 0 (never)


LogName <filename>
  Default value: 'sbu.log'.
  Optional parameter.
  See 1. for details.

LogNew <y (yes) or n (no)>
  Default value: No (append).
  Optional parameter.
  See 1. for details.

LogLvl <level>
  Default value: 4.
  Optional parameter.
  See 1. for details.

ScrLvl <level>
  Default value: 4.
  Optional parameter.
  See 1. for details.

ErrExit <number>
  Default value: 0 (never).
  Optional parameter.
  Number of errors occurs to stop operation.


		2.3 Default parameters.
		-----------------------

   Parameters which become default when specified before the first pass (the
first PathSrc keyword) in any order. Unlike of common parameters this can be
changed later for a current pass if specified within a PathSrc/PathDst block
(pass's values only, defaults aren't changed).

Sync		<y (yes) or n (no)>	; default is No
SubDir		<y (yes) or n (no)>	; default is Yes
SupEA		<y (yes) or n (no)>	; default is autodetect
CmpFileEA	<y (yes) or n (no)>	; default is No
CmpDirEA	<y (yes) or n (no)>	; default is No
UseArchive	<y (yes) or n (no)>	; default is No
CmpAttrMask	<hex mask>		; default is 27 (all)
CmpAttrReadonly	<y (yes) or n (no)>	; default is Yes
CmpAttrHidden	<y (yes) or n (no)>	; default is Yes
CmpAttrSystem	<y (yes) or n (no)>	; default is Yes
CmpAttrArchive	<y (yes) or n (no)>	; default is Yes


Sync <y (yes) or n (no)>
  Default value: No.
  Optional parameter.
  See 1. for details.

SubDir <y (yes) or n (no)>
  Default value: Yes.
  Optional parameter.
  If selected Yes then subdirectories will be scanned also.

SupEA <y (yes) or n (no)>
  Default value: autodetect.
  Optional parameter.
  Destination drive supports extended attributes (Yes) or not (No).

CmpFileEA <y (yes) or n (no)>
  Default value: No.
  Optional parameter.
  Compare (Yes) or not (No) files's EA (extended attributes) content and copy
  file if differ. If selected No then compare only size of EA.

CmpDirEA <y (yes) or n (no)>
  Default value: No.
  Optional parameter.
  Compare (Yes) or not (No) directory's EA (extended attributes) content. If
  selected Yes then set to destination directory the same EA like source has.

UseArchive <y (yes) or n (no)>
  Default value: No.
  Optional parameter.
  If selected Yes then Archive attribute will be unset for the source and
  destination files after copying or comparing. This may improves the file
  change recognition.

CmpAttrMask <hex mask>
  Default value: 27 (all attributes).
  Optional parameter.
  File's attributes mask for a file change recognition, one or two hex digit
  without any prefix. Alternative to CmpAttr* specification.
  The mask bits to be compared should be set to '1'; set the mask value to 0 to
  disable attributes comparation at all.
  Available attributes bits:
    Readonly   0x01
    Hidden     0x02
    System     0x04
    Archive    0x20

CmpAttrReadonly	<y (yes) or n (no)>
CmpAttrHidden   <y (yes) or n (no)>
CmpAttrSystem   <y (yes) or n (no)>
CmpAttrArchive  <y (yes) or n (no)>
  Default values: Yes.
  Optional parameters.
  Use (Yes) or not (No) file's attributes for a file change recognition.
  Alternative to CmpAttrMask specification.


		2.4 Pass's parameters.
		----------------------

  Each pass specification must starts with PathSrc and ends with PathDst
keywords (the only required parameters). Other optional parameters can be
specified between them in any order and take effect in the current pass only.

PathSrc		<source path>			; required parameter
CopyFile	<file1> [file2 file3 ...]	; optional parameter
SkipSrcFile 	<file1> [file2 file3 ...]	; optional parameter
SkipSrcDir 	<dir1> [dir2 dir3 ...]		; optional parameter
SkipSrcPath 	<path1> [path2 path3 ...]	; optional parameter
SkipDstFile 	<file1> [file2 file3 ...]	; optional parameter
SkipDstDir 	<dir1> [dir2 dir3 ...]		; optional parameter
SkipDstPath 	<path1> [path2 path3 ...]	; optional parameter
Sync		<y (yes) or n (no)>		; optional parameter
SubDir		<y (yes) or n (no)>		; optional parameter
SupEA		<y (yes) or n (no)>		; optional parameter
CmpFileEA	<y (yes) or n (no)>		; optional parameter
CmpDirEA	<y (yes) or n (no)>		; optional parameter
UseArchive	<y (yes) or n (no)>		; optional parameter
CmpAttrMask	<hex mask>			; optional parameter
CmpAttrReadonly	<y (yes) or n (no)>		; optional parameter
CmpAttrHidden	<y (yes) or n (no)>		; optional parameter
CmpAttrSystem	<y (yes) or n (no)>		; optional parameter
CmpAttrArchive	<y (yes) or n (no)>		; optional parameter
PathDst		<destination path>		; required parameter


PathSrc <source path>
  Required parameter.
  The exact source path name. Wildcard character '?' can be used instead
  of drive letter (-drv command-line option must be used also).

CopyFile <file1> [file2 file3 ...]
  Default value: '*' (any).
  Optional parameter.
  The source file name(s) to be copied, wildcard characters '*' and '?' are
  allowed.

SkipSrcFile <file1> [file2 file3 ...]
  Optional parameter.
  The source file name(s) to be skipped while scanning PathSrc (not to be
  copied). Wildcard characters '*' and '?' are allowed.

SkipSrcDir <dir1> [dir2 dir3 ...]
  Optional parameter.
  The exact source directory name(s) to be skipped while scanning PathSrc (not
  to be copied, including it's files and all nested subdirectories). Wildcard
  characters '*' and '?' are not allowed.

SkipSrcPath <path1> [path2 path3 ...]
  Optional parameter.
  The exact source path name(s) to be skipped while scanning PathSrc. If it is
  path to a file(s) then only that file(s) will be skipped (not to be copied).
  If it is directory(s) then that directory(s) will be skipped, including it's
  files and all nested subdirectories. Wildcard characters '*' and '?' are not
  allowed.

SkipDstFile <file1> [file2 file3 ...]
  Optional parameter.
  The destination file name(s) to be skipped while scanning PathDst (not to be
  synchronized). Wildcard characters '*' and '?' are allowed.

SkipDstDir <dir1> [dir2 dir3 ...]
  Optional parameter.
  The exact destination directory name(s) to be skipped while scanning PathDst
  (not to be synchronized, including it's files and all nested subdirectories).
  Wildcard characters '*' and '?' are not allowed.

SkipDstPath <path1> [path2 path3 ...]
  Optional parameter.
  The exact destination path name(s) to be skipped while scanning PathDst. If it
  is path to a file(s) then only that file(s) will be skipped (not to be
  synchronized). If it is directory(s) then that directory(s) will be skipped,
  including it's files and all nested subdirectories. Wildcard characters '*'
  and '?' are not allowed.

Sync <y (yes) or n (no)>
  Optional parameter.
  See 2.3 for details.

SubDir <y (yes) or n (no)>
  Optional parameter.
  See 2.3 for details.

SupEA <y (yes) or n (no)>
  Optional parameter.
  See 2.3 for details.

CmpFileEA <y (yes) or n (no)>
  Optional parameter.
  See 2.3 for details.

CmpDirEA <y (yes) or n (no)>
  Optional parameter.
  See 2.3 for details.

UseArchive <y (yes) or n (no)>
  Optional parameter.
  See 2.3 for details.

CmpAttrMask <hex mask>
  Optional parameter.
  See 2.3 for details.

CmpAttrReadonly	<y (yes) or n (no)>
CmpAttrHidden	<y (yes) or n (no)>
CmpAttrSystem	<y (yes) or n (no)>
CmpAttrArchive	<y (yes) or n (no)>
  Optional parameters.
  See 2.3 for details.

PathDst <destination path>
  Required parameter.
  The exact destination path name. Wildcard character '?' can be used instead
  of drive letter (-drv command-line option must be used also).


		3. Misc.
		--------

See also sample.cfg for example.

Home page http://os2acw.googlepages.com

