nnBackup Predefined Variables
nnBackup provides a number of predefined string variables which extend its capabilities in handling file names. These predefined string variables are mainly used for generating file names based on a current date, but they can be also used in any other string parameters.
Please note that when predefined variables are used in command line, they must be surrounded by quotation marks, otherwise the command interpreter may "eat them up". If you are planning to use variables in batch-files or in Win9*/ME command line, it is a good idea to surround each variable by double-percents (%%...%%). String variables stored in a text file with startup parameters are not subject to this problem.
Here is a list of all available string parameters:
%hh% | - current hour (00-23) |
%mm% | - current minute (00-59) |
%ss% | - current second (00-59) |
%MM% | - month (01-12) |
%MMM% | - month (Jan-Dec) |
%DD% | - day of a month (01-31) |
%WW% | - day of a week (Mo-Su) |
%WD% | - day of a week (1-7, where 1 is Monday, and 7 is Sunday) |
%YYYY% | - year (4 digits) |
%YY% | - year (last 2 digits) |
%crlf% | - carriage return followed by line feed |
%QUOTE% | - quotation mark (") |
%PERCENT% | - percent sign (%) |
%IDRIVE% | - drive letter of current source path (':\' symbols are not included) nnbackup.exe copy -i c:\data -o "%IDRIVE%:\backup\data"
-s |
%IPATH% | - path of current source directory without drive letter and following ':\' nnbackup.exe copy -i c:\program files\data -o "d:\backup\%IPATH%"
-s |
%INAME% | - name of current source directory (mentioned in -i option): nnbackup.exe copy -i c:\data -o "d:\backup\%INAME%" -s |
%ZIP-FILENAME% | - nnBackup internal variable, which contains the name of archive to be created by external command line archiver. |
%ZIP-LIST% | - nnBackup internal variable which contains the list of the files to be compressed by external archiver. |
%FOLDER-APP-DATA% | Application data folder |
%FOLDER-COMMON-DESKTOP% | Common desktop for all users |
%FOLDER-COMMON-STARTMENU% | Common Start menu |
%FOLDER-COMMON-PROGRAMS% | Common Programs menu |
%FOLDER-DESKTOP% | Desktop |
%FOLDER-FAVOURITES% | Favorites |
%FOLDER-PERSONAL% | Personal Folder |
%FOLDER-STARTMENU% | Start menu |
%FOLDER-PROGRAMS% | Programs menu |
%FOLDER-RECENT% | Documents menu (within Start menu) |
%FOLDER-SENDTO% | "Send to" menu |
%FOLDER-STARTUP% | Startup menu |
%FOLDER-TEMPLATES% | Templates folder |
%FOLDER-TEMP% | Temp folder (for temporary files) |
%FOLDER-WINDOWS% | Windows folder |
%FOLDER-SYSTEM% | System folder |
%FOLDER-PROFILE% | User directory |
%HOME-DIR% | Default directory where nnBackup configuration (backup.ini), temporary (dumpdates.txt, %ZIP-FILENAME%, %ZIP-FILELIST%) and log files are stored. More info. |
%USER-HOME-DIR% | The HOME environment variable value or the user directory if HOME is empty |
%NNBACKUP-DIR% | The program directory (where nnbackup.exe is located) |
Examples:
nnbackup.exe sync -i "c:\temp\%DD%-%MM%-%YY%" -o c:\temp\current_day_backup -s -e -ad -da -v
Explanation: Synchronise files in the directory whose name is the current date in 04-12-02 format with files in c:\temp\current_day_backup. During the synchronziation, take in account all subdirectories and display/write to log names and full pathes of files being copied. Remove from the output directory all files that do not existy in the input (source) directory. Copy all files that are different in any way (different size, older date etc.).
nnbackup.exe copy -i c:\data -i c:\another\data -o "d:\backup\daily_%MMM%%DD%" -s -v
Explanation: Copy files from c:\data and c:\another\data to a directory whose name contains the current date, for example d:\backup\daily_Dec04. Take in account all subdirectories in c:\data and display/write to log names and full pathes of files being copied.
nnbackup.exe copy -i c:\data -o d:\backup\data -s -v -log "d:\log\nnbackup\%DD%%MMM%%YYYY%.log"
Explanation: Copy files from c:\data to d:\backup\data. Take in account all subdirectories in c:\data and display/write to log names and full pathes of files being copied. Save information about the backup session to a log file having the current date for a name, for example, d:\log\nnbackup\05Dec2002.log.