2 .\" Copyright (c) 1996 Sun Microsystems, Inc. All Rights Reserved.
3 .\" Copyright 2015 Nexenta Systems, Inc. All rights reserved.
4 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
5 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
6 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
7 .TH PACKINGRULES 4 "Sep 8, 2015"
9 packingrules \- packing rules file for filesync
13 \fB$\fR\fBHOME\fR\fB/.packingrules\fR
18 \fB$\fR\fBHOME\fR\fB/.packingrules\fR is a packing rules file for
19 \fBfilesync\fR. \fB$\fR\fBHOME\fR\fB/.packingrules\fR
20 contains a list of directories and files that are to be packed and
21 synchronized. It also contains a list of directories and files that are to be
22 specifically excluded from packing and synchronization. See \fBfilesync\fR(1).
24 The \fB$\fR\fBHOME\fR\fB/.packingrules\fR file is automatically created if
25 users invoke \fBfilesync\fR with filename arguments. By using \fBfilesync\fR
26 options, users can augment the packing rules in
27 \fB$\fR\fBHOME\fR\fB/.packingrules\fR.
29 Many users choose to manually create the packing rules file and edit it by
30 hand. Users can edit \fB$\fR\fBHOME\fR\fB/.packingrules\fR (using any editor)
31 to permanently change the \fB$\fR\fBHOME\fR\fB/.packingrules\fR file, or to
32 gain access to more powerful options that are not available from the command
33 line (such as \fBIGNORE\fR commands). It is much easier to enter complex
34 wildcard expressions by editing the \fB$\fR\fBHOME\fR\fB/.packingrules\fR file.
36 Blank lines and lines that begin with a pound sign (`\fB#\fR') are ignored.
38 Any line can be continued by placing a backslash (`\fB\e\fR\&') immediately
39 before the \fBNEWLINE.\fR
41 All other lines in the \fB$\fR\fBHOME\fR\fB/.packingrules\fR file have one of
42 the following formats:
46 \fB\fBPACKINGRULES\fR\fR
50 \fImajor\fR. \fIminor\fR. This line is not actually required, but it should be
51 the first line of every packing rules file. This line identifies the packing
52 rules file for the \fBfile\fR(1) command and specifies a format version
53 number. The current version number is 1.1. See \fBfile\fR(1).
59 \fB\fBBASE\fR \fIdirectory-1\fR [\fIdirectory-2\fR]\fR
63 This line identifies a directory (or pair of directories) under which files
64 should be packed and synchronized. At least one directory name must be
65 specified. For rules that are to be used by \fBfilesync\fR a second directory
66 name (where the copies are to be kept) must also be specified. The arguments
67 must be fully qualified path names, and may include environment variables.
73 \fB\fBLIST\fR \fIname\fR \|.\|.\|.\fR
77 This line enumerates a list of files and sub-directories (beneath the current
78 \fBBASE)\fR that are to be kept synchronized. This specification is recursive,
79 in that specifying the name of a directory automatically includes all files and
80 subdirectories it contains. Regular expressions (as described in \fBglob\fR
81 and \fBgmatch\fR) are permitted. See \fBglob\fR(1) and \fBgmatch\fR(3GEN).
87 \fB\fBIGNORE\fR \fIname\fR \|.\|.\|.\fR
91 This line enumerates a list of files that are not to be kept synchronized.
92 Regular expressions (using \fBglob\fR and \fBgmatch\fR) are permitted.
97 There are important differences between the arguments to \fBLIST\fR and
98 \fBIGNORE\fR statements. The arguments to a \fBLIST\fR statement can contain
99 slashes and are interpreted as file names relative to the \fBBASE\fR
100 directories. The arguments to an \fBIGNORE\fR statement are simpler names or
101 expressions that cannot contain slashes. An \fBIGNORE\fR statement will not
102 override a \fBLIST\fR statement. \fBIGNORE\fR statements only exclude files
103 that are found beneath \fBLISTed\fR directories.
106 If the first name argument to a \fBLIST\fR statement begins with an
107 exclamation point (`\fB!\fR'), the remainder of the statement will be executed
108 as a command. The command will be run in the current \fBBASE\fR directory. The
109 output of the command will be treated as a list of newline separated file
110 names to be packed/synchronized. The resulting file names will be interpreted
111 relative to the enclosing \fBBASE\fR directory.
114 If the first name argument to an \fBIGNORE\fR statement begins with an
115 exclamation point (`\fB!\fR'), the remainder of the statement will be executed
116 as a command. The command will be run in the current \fBBASE\fR directory. The
117 command will be expected to figure out which names should not be synchronized.
118 The output of the command will be treated as a list of newline separated file
119 names that should be excluded from the packing and synchronization list.
122 Commands will be broken into distinct arguments and run directly with \fBsh
123 \fR\fB-c\fR. Blanks can be embedded in an argument by escaping them with a
124 backslash (`\fB\e\fR\&') or enclosing the argument in double quotes (`
125 \fB"\fR '). Double quotes can be passed in arguments by escaping the double quotes with
126 a backslash (`\fB\e\fR\&').
129 \fBLIST\fR lines only apply to the \fBBASE\fR statement that precedes them.
130 \fBIGNORE\fR lines can appear before any \fBBASE\fR statement (in which case
131 they apply to all \fBBASEs)\fR or after a \fBBASE\fR statement (in which case
132 they only apply to the \fBBASE\fR that precedes them). Any number of these
133 statements can occur in any combination. The order is not important.
136 \fBExample 1 \fRA sample \fB$\fR\fBHOME\fR\fB\&.packingrules\fR file.
139 The use of these statements is illustrated in the following
140 \fB$\fR\fBHOME\fR\fB\&.packingrules\fR file.
146 # junk files, not worth copying
148 IGNORE core *.o *.bak *%
150 # most of the stuff I want to keep in sync is in my $HOME
152 BASE /net/bigserver/export/home/myname $HOME
153 # everything in my work sub-directory should be maintained
155 # a few of my favorite mail boxes should be replicated
160 # I like to carry around a couple of project directories
161 # but skip all the postscript output
163 BASE /net/bigserver/export/projects $HOME/projects
164 LIST poindexter epiphany
167 # the foonly package should always be kept on every machine
169 BASE /net/bigserver/opt/foonly /opt/foonly
170 LIST !cat .packinglist
172 # and the latest executables for the standard build environment
174 BASE /net/bigserver/export/buildenv $HOME/buildenv
175 LIST !find . -type f -a -perm -111 -a -print
182 \fBfile\fR(1), \fBfilesync\fR(1)