nnBackup Commands and Command Line Options



nnBackup Commands

copy
copyz

- Copy files to create a backup copy. (The default mode).
- Copy files into compressed zip-archive.
ver
verz
- Copy data to a stack of numbered directories.
- Copy data to a stack of numbered zip archives .
sync
sync2
- Synchronisation of directories (onedirectional).
- Bidirectional synchronisation of directories (bidirectional).
dump <num> - Incremental backup (dump), num being the dump level (0-9).
fill <num> - Fill the specified package (fill), num being the package size in bytes, kilobytes (K) or megabytes (M).
delabsent - Delete absent data from a backup copy. (All files that are not present in the input directory will be deleted from the target directory).


Command line options

General Parameters

-i <from_path>

- Location of the input (source) directory, i. e. the directory from which files are copied to create a backup copy.
Several instances of option -i can be used in the same command line. Besides directories, this option can take as its argument a name of a file that should be copied: one filename per each instance of -i option.
Use the @filename syntax to state more than one input directory or source file in the same -i option or to use a filelist as an argument for this option.

-o <to_path> - Location of the output (target) directory, i.e. the directory to which files are copied to create a backup copy.
-ip <from_path> - Location of the input (source) directory on a modile devices connected using ActiveSync.
-op <to_path> - Location of the output (target) directory on a modile devices connected using ActiveSync.

-ini <[@]filename> - Use the specified settings file at nnBackup startup. (By default, it will be backup.ini).
-f <[@]filename> - Read nnBackup startup parameters from the specified text file
-nocopy - Test mode. nnBackup emulates the entire process according to the specified options, but does not actually copy any files. This option is used, for example, to test or debug a command line or to create filelists (see -list).

-c - Ignore any possible file errors during backup process
-cn <error_number> - Numbers of errors that can be ignored (in this case, do not use - option). To specify more than one error number, use several instances of -cn option or use the @filename syntax.
-tn <error_number> - Numbers of errors at which the backup process should be interrupted (if option - is used). To specify more than one error number, use several instances of -tn option or use the @filename syntax.
-ci - Ignore any errors in incoming data (e.g. inaccessibility of a source or target director). This option is convenient when the backup process is performed over a network when network resources can become temporarily inaccessible. Note, please, one should use -ci option before the -i and -o options (not after them).

-m masks

- Inclusive filename mask: process only those files that match this mask. If necessary, you can state several masks (separated by commas) after the same instance of option -m. It is also possible to use several instances of -m in a command line or to use @filename syntax. Note, please, if you include the '\' symbol (backslash) in the filename mask, the entire mask will be compared to the file relative path (counted off from the input directory).

-x masks

- Exclusive filename mask: do not process files that match this mask. If necessary, you can state several masks (separated by commas) after the same instance of option -x. It is also possible to use several instances of -x in a command line or to use @filename syntax. Note, please, if you include the '\' symbol (backslash) in the filename mask, the entire mask will be compared to the file relative path (counted off from the input directory).

-dm masks

- Inclusive directory name mask: process only those directories that match this mask. If necessary, you can state several masks (separated by commas) after the same instance of option -dm. It is also possible to use several instances of -dm in a command line or to use @filename syntax. Note, please, if you include the '\' symbol (backslash) in the directory name mask, the entire mask will be compared to the directory relative path (counted off from the input directory).

-dx masks

- Exclusive directory name mask: do not process directories that match this mask. If necessary, you can state several masks (separated by commas) after the same instance of option -dx. It is also possible to use several instances of -dx in a command line or to use @filename syntax. Note, please, if you include the '\' symbol (backslash) in the directory name mask, the entire mask will be compared to the directory relative path (counted off from the input directory).


-a {a|A|r|R|h|H|s|S|c|C|e|E|n|N}

- Inclusive file attributes mask: process only files with the specified file attributes. It is possible to use several instances of -a in a command line. Thus, to process all the files with attributes 'hidden' and 'system' use the following command line: -a h -a s.

-ax {a|A|r|R|h|H|s|S|c|C|e|E|n|N}

- Exclusive file attributes mask: do not process files with the specified file attributes. It is possible to use several instances of -ax in a command line. Thus, to process all the files but files with attributes 'hidden' and 'system' use the following command line: -ax h -ax s.

You can use the following parameters with options -a and -ax:

a or A - FILE_ATTRIBUTE_ARCHIVE
h or H - FILE_ATTRIBUTE_HIDDEN
r or R - FILE_ATTRIBUTE_READONLY
s or S - FILE_ATTRIBUTE_SYSTEM
n or N - FILE_ATTRIBUTE_NORMAL
c or C - FILE_ATTRIBUTE_COMPRESSED
e or E - FILE_ATTRIBUTE_ENCRYPTED

-tda
-tda-

- By default, nnBackup checks the directory attributes when backing up files. Use -tda- command line option if you don't want it to check the directory attributes.

-LT <bytes>

- Process only those files, which size is smaller than specified one (in bytes). (Details).

-GT <bytes>

- Process only those files, which size is greater than specified one (in bytes). (Details).

-EQ <bytes>

- Process only those files, which size equals to the specified one (in bytes). (Details).

-OR

- This modifier replaces logical 'AND' with logical 'OR' for command line options -LT, -GT and -EQ. (Details).


-D <date>

- Process only those files that has been modified (or created) after the specified date: files are selected by the date of their creation and last modification.

-DC <date>

- Process only those files that has been created after the specified date: files are selected by their creation date.
-DW <date> - Process only those files that has been modified after the specified date: files are selected by their modification date.

-DLT <date>

- Process only those files that has not been modified (or created) since the specified date: files are selected by the date of their creation and last modification.

-DCLT <date>

- Process only those files that has not been created since the specified date: files are selected by their creation date.
-DWLT <date> - Process only those files that has not been modified since the specified date: files are selected by their modification date.

Dates that are used with options -D, -DC and -DW should have the following format: DD-MM-YYYY[/hh[:mm[:ss]]]. You can use any non-numerical characters to separate fields, and the values of hours, minutes and seconds are optional: you can either skip them altogether, or specify hours only, or hours and minutes, or hours, minutes and seconds. Here are several examples to illustrate this:

-D 5-12-2002
-D 05-12-2002
-D 05-12-2002/20:20
-D 05-12-2002/20:20:20
-D 05x12x2002:20-20
-D 05/12/2002:20-20-20

It is also possible to use the @filename syntax:

-D @date.txt
-D @another_date.txt


-RD <relative_date>

- Process only those files that has been modified (or created) after the specified date: files are selected by the date of their creation and last modification.

-RDC <relative_date>

- Process only those files that has been created after the specified date: files are selected by their creation date.
-RDW <relative_date> - Process only those files that has been modified after the specified date: files are selected by their modification date.

Relative date that is used with options -RD, -RDC and -RDW should have the following format: DD[/hh[:mm]]. The values of hours and minutes are optional: you can either skip them altogether, or specify days only, or days and hours, or days and hours and minutes. Here are several examples to illustrate this:

-RD 05 (process only those files that has been created/modified during the last 5 days)
-RD 05/06 (process only those files that has been created/modified during the last 5 days and 6 hours)
-RD 00/08 (process only those files that has been created/modified during the last 8 hours)
-RD 10/06:30 (process only those files that has been created/modified during the last 10 days, 6 hours and 30 minutes)
-RD 00/00:30 (process only those files that has been created/modified during the last 30 minutes)
-RD 00/03:45 (process only those files that has been created/modified during the last 3 hours and 45 minutes)

It is also possible to use the @filename syntax:

-RD @date.txt
-RD @another_date.txt


-TD - Check the directory creation/modification time together with the creation/modification time of the files.

-s - Take in account all subdirectories when performing the backup, i.e. process files in the source directory and all its subdirectories
-e - Copy empty directories
-sa - Copy access rights. (Works on NTFS only)
-A - Clear 'archive' file-attribute after copying
-d - Delete the files that were copied from the input (source) directory. The directories are not deleted. The -d option works in all nnBackup modes except dump (using zip compression) and verz.

-p - When copying a file to an output directory, duplicate the directory structure corresponding to the file's full path in the input directory. (Details).
-p1, -p2, -p3, -p4
-pn <num>
- When copying a file to an output directory, create the directory structure according to the specified nesting level. (Details).

-flat - Gathering files from several folders, directory tree or entire volume into the files in one specified directory. This way the directory structure can be 'flatten'. Note, please: the files with the same names are overwritten without prompt.

-list <[@]filename> - Save a list of all copied files to a specified text file. Use of @filename syntax is allowed. (By default, relative paths of files are saved in a list).
-list2 <[@]filename> - Save to a specified text file a list of all files that were copied from the output directory to the input directory during bidirectional synchronisation. Use of @filename syntax is allowed. (By default, relative paths of files are saved in a list).
-list3 <[@]filename> - Save a list of all deleted files and directories to a specified text file. Use of @filename syntax is allowed. (By default, relative paths of files are saved in a list).
-fp - Save full (absolute) paths to a file-list.

Compression

-gz - Use gzip compression. (Note, please: the existing compression libraries impose a limitation on the size of zip archives that can be created: they cannot be larger than 2 gigabyte.)
-zip - Use zip compression. (Note, please: the existing compression libraries impose a limitation on the size of zip archives that can be created: they cannot be larger than 2 gigabyte.)
-zx masks - Masks of files that should not be compressed. Use of @filename syntax is allowed.
-pw password - set the password to the zip file that is being created. Note, please, this feature is not fully implemented yet. You will need a standalone tool (miniunz) to open a zip file with password. Use at your own risk! :)
-zmin <num> - Minimum size (in bytes) of files that should be compressed. Smaller files won't be compressed.
-zcomm "comment" - Comment to the zip file that is being created.
-zl <num> - Level of compression (0-9), the default level being 5.
-zlf <zip-list-filename> - Set the name and the location of the file-list passed to the external command line archiver.
-zleollf - Use LF instead CRLF of when creating the file-list passed to the external command line archiver (for UNIX-based archiver, like TAR).
-extzip <ArchiverName>

- This option is used in copyz, verz and dump modes to call the external archiver. The command line for the preferred external archiver is set in the backup.ini variable ExtZip:.
Here are some examples of -extzip usage:

nnbackup.exe copyz -i c:\data -i c:\another_data -o d:\backup\data -s -p -v -stats -extzip RAR
nnbackup.exe verz -n 7 -i c:\data -o d:\backup -s -x *.tmp -v -extzip 7z
nnbackup.exe dump 0 -i c:\data -i c:\another_data -o d:\backup\data -s -v -extzip 7z

Logging

-v - Display/write to log paths of files that are being copied (verbose mode).
Information about the files that are being copied is displayed on console (unless option -q is used) and saved to a log file (if option -log is used).
-log <[@]filename> - Log messages to a specified log file (see also value of Logtime: variable in bakup.ini). Use of @filename syntax is allowed.
-ll <num> - log levels to control over the amount and detail of the log output. The higher is the num value (0-9), the more info is logged: 0 - critical errors only, 1 - critical errors + standard messages etc. Default value: 1.
-q

- Do not display messages on console (quiet mode).
This option does not affect the info that are logged in a log file (when option -log is used).

-tbeg <[@]filename>

- Logs the starting time of a backup session to a specified log file. Use of @filename syntax is allowed.

-tend <[@]filename>

- Logs the finishing time of a backup session to a specified log file. Use of @filename syntax is allowed.

Running External Processes

-rb "command line" - Run an application before starting the main process. Use of @filename syntax is allowed.
-dirb "dir" - Set a current working directory for the application specified in -rb option. Use of @filename syntax is allowed.
-pbs - Run the main process only if the error code returned by the application specified in -rb option is 0
-ra "command line" - Run an application immediately after the main process is completed. Use of @filename syntax is allowed.
-dira "dir" - Set a current working directory for the application specified in -ra option. Use of @filename syntax is allowed.
-rps - Run the application specified in -ra option only if the main process has been successfully completed

Miscellaneous Options

-?
-h
- Display a help message
-lang <language>

- Set the language to be used in messages on console and in log files.

-hd <home-dir> - Set the default directory where nnBackup configuration (backup.ini), temporary (dumpdates.txt, %ZIP-FILENAME%, %ZIP-FILELIST%) and log files are stored.
-ddf <dumpdates-filename> - Set the name and the location of the file, containing the dates of previous backup sessions in dump mode.
-stat - Outputs the short statistics to the log file and the console window. Total number of processed files/folders and total amount of copied data (in bytes) is available.

Options for the Mode of Copying Data to a Stack of Directories/ZIP
Archives (ver/verz)

-n N - Depth of a stack of directories/zip archives. If option -n is not specified or is equal to 0, no stack is created.
-sdn "string" - A string that is appended to a name of directory/zip archive. If this option is used, then a stack of directories/zip archives will look like this: 1_string, 2_string ... N_string. Use of @filename syntax is allowed.
-pc - Shift the stack or directories/zip archives only if some changes are found in the input directory (i.e. one or more files had been changed, added, removed)

Options for Files and Directories Synchronisation Mode (sync/sync2)

-tc

- When performing synchronisation, compare not only the time of last modification of a file, but the time of its creation as well

-t2 - Compare time of last modification of files with two-second precision (FAT time format). If this option is not used, even milliseconds are taken in account (NTFS time format).
It would be good idea to use option -t2 to ignore the minor differences in the times of last modification of files which appear when files were transferred from FAT to NTFS and vice versa.
-ts <time-offset-seconds> - Set the time zone (or daysaving time) difference between your local files and the files on the remote server. Use numbers >0 if the server is to the west, and <0 if it is to the east of your location: nnbackup.exe sync ... -ts +3600 or nnbackup.exe sync ... -ts -3600.
-ad

- Copy not only new files and/or files with a later modification date, but also the files whose modification date has changed "in the opposite direction", or those whose date hasn't changed at all, but the file size or access rights were changed (use both the options -ad and -sa to copy the files, which access rights were changed).

-it - Ignore time stamping when performing synchronisation. Note, please, that -it option silently includes the -ad functionality.
-md5

- During synchronisation, generate and compare the cheksums of files (md5). If checksums of a file and it's backup copy are different, it will be copied.

-existing - Synchronise only the files, that already exists in output directory.
-ignore-existing

- Synchronise all the files, except these that already exists in output directory.

-da - Remove from the output directory those files and directories that do not exist in the input directory. The files are removed after the copying is complete: first all the new and updated files are copied, and then the files that do not exist in the input directory are deleted from the output directory. This option does not works when bidirectional synchronisation (sync2) is used!
-delete-before

- Exactly as -da option, with the following exception: first all the files that do not exist in the input directory are deleted from the output directory and only then the new and updated files are copied. Note, that usage of -delete-before option automatically turns on the -da option.

-delete-excluded

- Exactly as -da option, with the following exception: not only the files that do not exist in the input directory will be removed from the output directory, but all the files, that match the exclusive filename mask -x as well. Note, that usage of -delete-excuded option automatically turns on the -da option.

-nd

- During synchronisation, do not remove the subdirectories that no longer exist in the input directory but still are present in the output directory.

-backup <dir_path>

- Save all the files, that were overwritten during synchronisation to the specified directory.
In the case of onedirectional synchronisation the overwritten files from output directory will be saved. In the case of bidirectional synchronisation the overwritten files from input and output directories will be saved.

Options for the Mode of Incremental Backup (dump)

-tc

- When creating incremental backups, take in account not only the last modification time, but the time of creation a file as well

-pw password - Set the password to the zip file that is being created. Note, please, this feature is not fully implemented yet. You will need a standalone tool (miniunz) to open a zip file with password. Use at your own risk! :)
-nozip - Instead of compressing the dumps into zip archives, save the backup data in directories with corresponding names.
-dn "string" - Name of the dump to create (zip file/directory). By default it is "%DumpLevel @%_%YYYY%-%MM%-%DD%". Use of @filename syntax is allowed.
-dumple - Allows you to copy only those files that were created or changed since the time of the last dump whose number is less than or equal to the current dump. Without this option nnBackup is copying the files that were created or changed since the time of the last dump whose number is less than the current dump.

Options for the Mode of Filling the Specified Package of any Size (fill)

-cs <num>

- Set the cluster size (in bytes). The default cluster size value is 2048 - this is the default cluster size for data CDs.

-sl <num>

- Set the split level: the directory tree level starting from which nnBackup will take each folder inside it as an undivideable whole and will try to copy it to the package without splitting. The level '0' means the lowest nested level - all the subfolders of an input directory. The level '1' is one step higher in the directory tree nesting level etc... If the overall size of a subfolder, which is set to be undivideable whole, is bigger than specified size of a package, nnBackup will stop processing files and show a warning with the name and size of the folder(s) that do not fits to the package.

Options for the Mode of Deleting Absent Data (delabsent)

-il <[@]filename>

- Location of a list of files against which files in the target directory will be checked. All files that are not in the list will be deleted from the target directory. nnBackup does not check if the listed files actually exist. This option is used instead of -i.

-il- <[@]filename> - Location of a list of a files to be removed from the target directory. All files that are in the list will be deleted from the target directory. nnBackup does not check if the listed files actually exist. This option is used instead of -i.

Notice: If a certain command line option takes some parameters as its argument, then it is possible to use @filename to cause nnBackup to read this parameters from a specified text file. For example, it is possible to read from a file masks of file-names (-m @masks.txt), or a list of input directories(-i @input.txt), a date of file modification (-D @date.txt) etc. When storing parameters in a text file, place each parameter on a separate line. This subject is discussed in detail in the section titled "Storing Startup Parameters in a Text File".