Creating a Directory Structure in the Output Directory
Instead of just piling up all the files from input directory into the output directory, you can create there a directory structure with the specified nesting level. Use options -p, -p1...4 and -pn <num> for this purpose.
Let's suppose that we copy files from c:\very\important\data into d:\backup:
nnbackup.exe copy -i c:\very\important\data -o d:\backup -s -v
If we add option -p to our command, then the program will create inside the output directory a directory structure matching the full path of input directory; in our example, the files will be copied to d:\backup\very\important\data:
nnbackup.exe copy -i c:\very\important\data -o d:\backup -p -s -v
The nesting level of a new directory structure can be set with options -p1...4 and -pn <num>. Number 1 would mean the the newly created structure will contain just one directory with the same name as the input directory (it would be data in our case), 2 would mean a two-level structure with the names of the input directory and the directory one level above it (important\data), 3 would mean that three-level directory structure is created (very\important\data) etc.:
nnbackup.exe copy -i c:\very\important\data -o d:\backup -p1 -s -v nnbackup.exe copy -i c:\very\important\data -o d:\backup -pn 1 -s -v
Explanation: Copy all files from c:\very\important\data and all its subdirectories to d:\backup\data
nnbackup.exe copy -i c:\very\important\data -o d:\backup -p2 -s -v nnbackup.exe copy -i c:\very\important\data -o d:\backup -pn 2 -s -v
Explanation: Copy all files from c:\very\important\data and all its subdirectories to d:\backup\important\data
nnbackup.exe copy -i c:\very\important\data -o d:\backup -p -s -v nnbackup.exe copy -i c:\very\important\data -o d:\backup -p3 -s -v nnbackup.exe copy -i c:\very\important\data -o d:\backup -pn 3 -s -v
Explanation: Copy all files from c:\very\important\data and all its subdirectories to d:\backup\very\important\data
As you perhaps realized, option -p1...4 is just a "shorthand version" of option -pn 1...4. It was created for users convenience, and there is no functional differences between the two options.
Another way to create required subdirectories in the output directory is to use nnBackup predefined variables %IPATH% and %INAME%. Variable %IPATH% contains the full path to the input directory (without the drive letter and the ":\"), and variable %INAME% just contains the name of the input directory:
nnbackup.exe copy -i c:\very\important\data -o d:\backup\%IPATH% -s -v
Explanation: Copy all files from c:\very\important\data and all its subdirectories to d:\backup\very\important\data
nnbackup.exe copy -i c:\very\important\data -o d:\backup\%INAME% -s -v
Explanation: Copy all files from c:\very\important\data and all its subdirectories to d:\backup\data
Examples:
nnbackup.exe copy -i c:\data -i c:\another_data -o d:\backup -p -s -v
Explanation: Copy all files from c:\data, c:\another_data and all their subdirectories to d:\backup\data and d:\backup\another_data
nnbackup.exe copy -i c:\data\opera -o d:\backup -pn 1 -s -v
Explanation: Copy all files from c:\data\opera and all its subdirectories to d:\backup\opera