File Formats packingrules(4)
NAME
packingrules - packing rules file for cachefs and filesync
SYNOPSIS
$HOME/.packingrules
DESCRIPTION
$HOME/.packingrules is a packing rules file for filesync and
cachefspack. $HOME/.packingrules contains a list of direc-
tories and files that are to be packed and synchronized. It also contains a list of directories and files that are to be specifically excluded from packing and synchronization. See filesync(1) and cachefspack(1M).The $HOME/.packingrules file is automatically created if
users invoke filesync with filename arguments. By using filesync options, users can augment the packing rules in$HOME/.packingrules.
Many users choose to manually create the packing rules fileand edit it by hand. Users can edit $HOME/.packingrules
(using any editor) to permanently change the$HOME/.packingrules file, or to gain access to more powerful
options that are not available from the command line (such as IGNORE commands). It is much easier to enter complexwildcard expressions by editing the $HOME/.packingrules
file.Blank lines and lines that begin with a pound sign (`#')
are ignored. Any line can be continued by placing a backslash (`\') immediately before the NEWLINE.All other lines in the $HOME/.packingrules file have one of
the following formats: PACKINGRULES major. minor. This line is not actually required, but it should be the first line of every packing rules file. This line identifies the packing rules file for the file(1) command and specifies a format version number. The current version number is 1.1. See file(1).SunOS 5.11 Last change: 23 Dec 1996 1
File Formats packingrules(4)
BASE directory-1 [directory-2]
This line identifies a directory (or pair of direc-
tories) under which files should be packed and synchron-
ized. At least one directory name must be specified. For rules that are to be used by filesync a second directory name (where the copies are to be kept) must also be specified. The arguments must be fully qualified path names, and may include environment variables. LIST name ...This line enumerates a list of files and sub-directories
(beneath the current BASE) that are to be kept syn-
chronized. This specification is recursive, in that specifying the name of a directory automaticallyincludes all files and subdirectories it contains. Regu-
lar expressions (as described in glob and gmatch) are permitted. See glob(1) and gmatch(3GEN). IGNORE name ... This line enumerates a list of files that are not to be kept synchronized. Regular expressions (using glob and gmatch) are permitted. There are important differences between the arguments toLIST and IGNORE statements. The arguments to a LIST state-
ment can contain slashes and are interpreted as file names relative to the BASE directories. The arguments to anIGNORE statement are simpler names or expressions that can-
not contain slashes. An IGNORE statement will not override a LIST statement. IGNORE statements only exclude files that are found beneath LISTed directories. If the first name argument to a LIST statement begins with an exclamation point (`!'), the remainder of the statement will be executed as a command. The command will be run in the current BASE directory. The output of the command will be treated as a list of newline separated file names to bepacked/synchronized. The resulting file names will be inter-
preted relative to the enclosing BASE directory. If the first name argument to an IGNORE statement begins with an exclamation point (`!'), the remainder of the statement will be executed as a command. The command will beSunOS 5.11 Last change: 23 Dec 1996 2
File Formats packingrules(4)
run in the current BASE directory. The command will beexpected to figure out which names should not be synchron-
ized. The output of the command will be treated as a list of newline separated file names that should be excluded from the packing and synchronization list. Commands will be broken into distinct arguments and rundirectly with sh -c. Blanks can be embedded in an argument
by escaping them with a backslash (`\') or enclosing the argument in double quotes (` " '). Double quotes can be passed in arguments by escaping the double quotes with a backslash (`\'). LIST lines only apply to the BASE statement that precedes them. IGNORE lines can appear before any BASE statement (inwhich case they apply to all BASEs) or after a BASE state-
ment (in which case they only apply to the BASE that pre-
cedes them). Any number of these statements can occur in any combination. The order is not important.EXAMPLES
Example 1 A sample $HOME.packingrules file.
The use of these statements is illustrated in the following$HOME.packingrules file.
#
# junk files, not worth copying
#
IGNORE core *.o *.bak *%
#
# most of the stuff I want to keep in sync is in my $HOME
#
BASE /net/bigserver/export/home/myname $HOME
# everything in my work sub-directory should be maintained
LIST work# a few of my favorite mail boxes should be replicated
LIST m/incoming LIST m/action LIST m/pending#
# I like to carry around a couple of project directories
# but skip all the postscript output
#
BASE /net/bigserver/export/projects $HOME/projects
LIST poindexter epiphany IGNORE *.ps#
SunOS 5.11 Last change: 23 Dec 1996 3
File Formats packingrules(4)
# the foonly package should always be kept on every machine
#
BASE /net/bigserver/opt/foonly /opt/foonly LIST !cat .packinglist#
# and the latest executables for the standard build environment
#
BASE /net/bigserver/export/buildenv $HOME/buildenv
LIST !find . -type f -a -perm -111 -a -print
SEE ALSO
file(1), filesync(1), cachefspack(1M)SunOS 5.11 Last change: 23 Dec 1996 4