The main function then checks the value of the pos variable. When the value
isn't -1, the function verifies that the line references an existing file or
folder, then uses the FileDB object's Include method to add that file or folder
to its internal Recordset object. When NTBackup backs up folders, it always
backs up subfolders as well, so the Include method's Recurse parameter has the
value true.
When the line contains the name of a file or folder that's to be excluded from
backup, the main function uses the substring method at callout D to extract
a copy of the string that doesn't include the " /exclude" portion. The function
then determines whether the extracted substring specifies an existing file or
folder. When it does, the main function calls the FileDB object's Exclude method
to remove matching files from FileDB's Recordset. Because NTBackup always excludes
subfolders of folders that it doesn't back up, the Exclude method's Recurse
parameter is also true.
After each line of the .bks file has been read and processed, the main function
closes the TextStream object and calls the FileDB object's WriteCSV method to
create the CSV file.
Using the Script
You can use NTCatalog.js as part of your scheduled backup routine to create
a CSV file containing the names of files to be backed up. Later, if you need
to search for a file in a backup set, you can import the CSV file into a database
tool and quickly find what you're looking for, saving time and energy.
Rob
robcohen November 30, 2006 (Article Rating: