Views

How do I make my directive skip/include this file?

This Wiki is brought to you by Backup Central, where you can find the Mr. Backup Blog, Forums, and a mailing list for each forum!

Backup FAQs Service Providers Backup Software Backup Hardware Backup Book Wiki Free Stuff Miscellaneous


Directives are not well documented by Legato, but what information exists can be found in the man pages for nsr(5), nsr_directive(5), uasm(1m) for UNIX. Use quotes to handle white spaces & other nonstandard characters.

(Has anyone had any experience with using ``%20" in substitution for white space?)

Filenames (and extensions of type *.tmp) are case sensitive, but paths are not.

Example directives can be found in the Administrator's Guide and the man page for nsr(5). Here are some OS-specific tips:

For NT

Make sure the backslash indicating the root directory is included and paths that include a colon need to be quoted. Example:


 << F:\ >>
 [instructions]


should instead read


 << "F:\" >>
 [instructions]

If explorer is set to not show file name extentions, winworkr.exe won't either.

For savesets on Win/NT/2000 servers, Networker prefers to to have savesets in all uppercase. Mixed or lowercase clientname:c:\temp save: using 'C:\TEMP' for 'c:\temp'


For Novell

see Legato Tech Note 062. S. Bjorndal's points about NT also apply to Netware.


For UNIX

note file pattern matching or wildcards follows sh(1) practice, not regex, or C or Korn shell practices. As Ulrich Oldendorf reminded me in private email, wild cards only work for files, not directories.

The message "clientname:c:\temp save: using `C:\TEMP' for `c:\temp'" appears in NT4 and Win2k with NW6.0.x. Server side Directives


As a general rule, code directives only to specifically exclude those files you want to leave out, in conjunction with the "ALL" saveset definition. That way, if new directories are created, they will be automatically included in the backup without requiring action from the backup administrator.


A directive has 2 parts, the header , which sets the directory the directive applies to, and the action or information section, where you tell the directive what rule to apply.


The header is enclosed in double angle brackets, eg << "/" >> and must be a directory name no wildcards allowed!

Networker seems to have problems dealing with long directives, so try and keep them as short as possible.


Note for windows users: It seems that using standard windows text editors such as Notepad can insert invisible formatting characters into your directives, leading to errors. The workaround I discovered for this was to edit the directives directly via the admin GUI, a bit less comfortable perhaps, but it seems to help!


· Special Characters (/_$% blanks in filenames etc)


Place your directory name inside double quotes in the header.


<< "C:\" >>
<< "C:\My directory goes here" >>
<< "/open/sesame" >>

If special characters appear elsewhere in your directive, quote these as well:


<< "/" >>
+skip:  "shock_horror!"

· Case Sensitive

Directory / File names should appear in directives in the same case as on the system:


<< "C:\MyDir" >>  and   << "C:\mydir" >>


are evaluated differently, even on Windows systems where case is normally not an issue on filenames.

In practice it looks as if Networker is able to handle case conversion when there are differences between the directive and the file system, however this will result in informational messages in your savegroup logs. Better to respect case.


· remember to include a blank as a spacer in the directive heading


For example:

<< "/usr/var" >>


· one blank line at the beginning of the directive

_ TOF_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

<< "/export/home" >>

· to skip a file(s)

I have observed that after your "skip" or "+skip" statement, Networker prefers to have 2 spaces before the file or directory name. With only one space the directive doesn~Rt work (ie. throws an error in your savegroup messages) ! This maybe something platform specific to windows, but seems worth mentioning.


<< "C:\Temp" >>
skip:  MyFile.mdb Myfile2.txt


don't backup MyFile.mbd or Myfile2.txt in the directory C:\Temp. If this was the only directive defined for this directory, all other files, including new ones when they are added would be backed up.

Directives only apply to the directory they are specified for, unless they are preceded by the "+" character.


· skip recursive (all files and subdirectories)


<< "C:\" >>
+skip:  *.mp3
<< "E:\Databases" >>
+skip  *.DAT


don~Rt back up any files on the C:\ drive with file type .mp3, or in E:\Databases and subdirectories with the .DAT file type


another skip example:


<< "/usr" >>
+skip: cache


don't backup any subdirectories or files in the directory that match ~Scache~T eg. /usr/netscape/user1/cache would be excluded.


· ON NT

if specifying an entire drive, remember to include the slash


<< "F:\" >>
+skip:  "My Program Files"
+skip:  *.tmp


· On Unix

an efficient way of excluding directories looks like this:


<< "/" >>
+skip:  core 
+skip:  "TT_DB" 
+skip:  cdrom
+skip:  home
+skip:  "lost+found"
+skip:  mnt 
+skip:  proc
+skip:  tmp