.ugarit
files
By default, Ugarit will vault everything it finds in the filesystem
tree you tell it to snapshot. However, this might not always be
desired; so we provide the facility to override this with .ugarit
files, or global rules in your .conf
file.
Note: All of this only applies to snapshots. Archive mode imports are
not affected by .ugarit
files, or global rules.
Note: The syntax of these files is provisional, as I want to experiment with usability, as the current syntax is ugly. So please don't be surprised if the format changes in incompatible ways in subsequent versions!
In quick summary, if you want to ignore all files or directories
matching a glob in the current directory and below, put the following
in a .ugarit
file in that directory:
(* (glob "*~") exclude)
You can write quite complex expressions as well as just globs. The full set of rules is:
(glob "pattern")
matches files and directories whose names match the glob pattern
(name "name")
matches files and directories with exactly that name (useful for files called*
...)
(modified-within number seconds)
matches files and directories modified within the given number of seconds
(modified-within number minutes)
matches files and directories modified within the given number of minutes
(modified-within number hours)
matches files and directories modified within the given number of hours
(modified-within number days)
matches files and directories modified within the given number of days
(not rule)
matches files and directories that do not match the given rule
(and rule rule...)
matches files and directories that match all the given rules
(or rule rule...)
matches files and directories that match any of the given rules
Also, you can override a previous exclusion with an explicit include in a lower-level directory:
(* (glob "*~") include)
You can bind rules to specific directories, rather than to "this directory and all beneath it", by specifying an absolute or relative path instead of the `*`:
("/etc" (name "passwd") exclude)
If you use a relative path, it's taken relative to the directory of
the .ugarit
file.
You can also put some rules in your .conf
file, although relative
paths are illegal there, by adding lines of this form to the file:
(rule * (glob "*~") exclude)