1 '\" te
   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"
   8 .SH NAME
   9 packingrules \- packing rules file for filesync
  10 .SH SYNOPSIS
  11 .LP
  12 .nf
  13 \fB$\fR\fBHOME\fR\fB/.packingrules\fR
  14 .fi
  15 
  16 .SH DESCRIPTION
  17 .sp
  18 .LP
  19 \fB$\fR\fBHOME\fR\fB/.packingrules\fR is a packing rules file for
  20 \fBfilesync\fR. \fB$\fR\fBHOME\fR\fB/.packingrules\fR
  21 contains a list of directories and files that are to be packed and
  22 synchronized.  It also contains a list of directories and files that  are to be
  23 specifically excluded from packing and synchronization. See  \fBfilesync\fR(1).
  24 .sp
  25 .LP
  26 The \fB$\fR\fBHOME\fR\fB/.packingrules\fR file is automatically created if
  27 users invoke \fBfilesync\fR with filename arguments. By using \fBfilesync\fR
  28 options, users can augment the packing rules in
  29 \fB$\fR\fBHOME\fR\fB/.packingrules\fR.
  30 .sp
  31 .LP
  32 Many users choose to manually create the packing rules file and edit it by
  33 hand. Users can edit \fB$\fR\fBHOME\fR\fB/.packingrules\fR (using any editor)
  34 to permanently change the \fB$\fR\fBHOME\fR\fB/.packingrules\fR file, or to
  35 gain access to more powerful options that are not available from the command
  36 line (such as \fBIGNORE\fR commands). It is much easier to enter complex
  37 wildcard expressions by editing the \fB$\fR\fBHOME\fR\fB/.packingrules\fR file.
  38 .sp
  39 .LP
  40 Blank lines and lines that begin with a pound sign  (`\fB#\fR') are ignored.
  41 .sp
  42 .LP
  43 Any line can be continued by placing a backslash  (`\fB\e\fR\&') immediately
  44 before the  \fBNEWLINE.\fR
  45 .sp
  46 .LP
  47 All other lines in the  \fB$\fR\fBHOME\fR\fB/.packingrules\fR file have one of
  48 the following formats:
  49 .sp
  50 .ne 2
  51 .na
  52 \fB\fBPACKINGRULES\fR\fR
  53 .ad
  54 .sp .6
  55 .RS 4n
  56 \fImajor\fR. \fIminor\fR. This line is not actually required, but it should be
  57 the first  line of every packing rules file. This line identifies the packing
  58 rules file for the  \fBfile\fR(1) command and specifies a format version
  59 number. The current version number is 1.1. See \fBfile\fR(1).
  60 .RE
  61 
  62 .sp
  63 .ne 2
  64 .na
  65 \fB\fBBASE\fR \fIdirectory-1\fR [\fIdirectory-2\fR]\fR
  66 .ad
  67 .sp .6
  68 .RS 4n
  69 This line identifies a directory (or pair of directories) under which files
  70 should be packed and synchronized. At least one directory name must be
  71 specified. For rules that are to be used by \fBfilesync\fR a second directory
  72 name (where the copies are to be kept) must also be specified. The arguments
  73 must be fully qualified path names, and may include environment variables.
  74 .RE
  75 
  76 .sp
  77 .ne 2
  78 .na
  79 \fB\fBLIST\fR \fIname\fR \|.\|.\|.\fR
  80 .ad
  81 .sp .6
  82 .RS 4n
  83 This line enumerates a list of files and sub-directories  (beneath the current
  84 \fBBASE)\fR that are to be kept  synchronized. This specification is recursive,
  85 in that specifying the name of a directory automatically includes all files and
  86 subdirectories it contains. Regular expressions  (as described in \fBglob\fR
  87 and \fBgmatch\fR) are permitted. See \fBglob\fR(1) and  \fBgmatch\fR(3GEN).
  88 .RE
  89 
  90 .sp
  91 .ne 2
  92 .na
  93 \fB\fBIGNORE\fR \fIname\fR \|.\|.\|.\fR
  94 .ad
  95 .sp .6
  96 .RS 4n
  97 This line enumerates a list of files that are not to be kept synchronized.
  98 Regular expressions  (using \fBglob\fR  and \fBgmatch\fR) are permitted.
  99 .RE
 100 
 101 .sp
 102 .LP
 103 There are important differences between the arguments to \fBLIST\fR and
 104 \fBIGNORE\fR statements. The arguments to a \fBLIST\fR statement can contain
 105 slashes and are interpreted as file names relative to the  \fBBASE\fR
 106 directories. The arguments to an \fBIGNORE\fR statement are simpler names or
 107 expressions that cannot contain slashes. An \fBIGNORE\fR statement will not
 108 override a \fBLIST\fR statement. \fBIGNORE\fR statements only exclude files
 109 that are found beneath \fBLISTed\fR directories.
 110 .sp
 111 .LP
 112 If the first name argument to a  \fBLIST\fR statement begins with an
 113 exclamation point  (`\fB!\fR'), the remainder of the statement will be executed
 114 as a command. The command will be run in the current \fBBASE\fR directory. The
 115 output of the command will be treated as a  list of newline separated file
 116 names to be packed/synchronized. The resulting file names will be interpreted
 117 relative to the enclosing  \fBBASE\fR directory.
 118 .sp
 119 .LP
 120 If the first name argument to an  \fBIGNORE\fR statement begins with an
 121 exclamation point  (`\fB!\fR'), the remainder of the statement will be executed
 122 as a command. The command will be run in the current \fBBASE\fR directory. The
 123 command will be expected to figure out which names should not be synchronized.
 124 The output of the command will be treated as a list of newline separated file
 125 names that should be excluded from the packing and synchronization list.
 126 .sp
 127 .LP
 128 Commands will be broken into distinct arguments and run directly with  \fBsh
 129 \fR\fB-c\fR. Blanks can be embedded in an argument by escaping them with a
 130 backslash (`\fB\e\fR\&') or enclosing the argument in  double quotes (`
 131 \fB"\fR '). Double quotes can be passed in arguments by escaping the double quotes with
 132 a backslash (`\fB\e\fR\&').
 133 .sp
 134 .LP
 135 \fBLIST\fR lines only apply to the  \fBBASE\fR statement that precedes them.
 136 \fBIGNORE\fR lines can appear before any  \fBBASE\fR statement (in which case
 137 they apply to all \fBBASEs)\fR or after a  \fBBASE\fR statement (in which case
 138 they only apply to the  \fBBASE\fR that precedes them). Any number of  these
 139 statements can occur in any combination. The order is not important.
 140 .SH EXAMPLES
 141 .LP
 142 \fBExample 1 \fRA sample \fB$\fR\fBHOME\fR\fB\&.packingrules\fR file.
 143 .sp
 144 .LP
 145 The use of these statements is illustrated in the following
 146 \fB$\fR\fBHOME\fR\fB\&.packingrules\fR file.
 147 
 148 .sp
 149 .in +2
 150 .nf
 151 #
 152 # junk files, not worth copying
 153 #
 154 IGNORE core *.o *.bak *%
 155 #
 156 # most of the stuff I want to keep in sync is in my $HOME
 157 #
 158 BASE /net/bigserver/export/home/myname $HOME
 159 # everything in my work sub-directory should be maintained
 160 LIST work
 161 # a few of my favorite mail boxes should be replicated
 162 LIST m/incoming
 163 LIST m/action
 164 LIST m/pending
 165 #
 166 # I like to carry around a couple of project directories
 167 # but skip all the postscript output
 168 #
 169 BASE /net/bigserver/export/projects $HOME/projects
 170 LIST poindexter epiphany
 171 IGNORE *.ps
 172 #
 173 # the foonly package should always be kept on every machine
 174 #
 175 BASE /net/bigserver/opt/foonly /opt/foonly
 176 LIST !cat .packinglist
 177 #
 178 # and the latest executables for the standard build environment
 179 #
 180 BASE /net/bigserver/export/buildenv $HOME/buildenv
 181 LIST !find . -type f -a -perm -111 -a -print
 182 .fi
 183 .in -2
 184 .sp
 185 
 186 .SH SEE ALSO
 187 .sp
 188 .LP
 189 \fBfile\fR(1), \fBfilesync\fR(1)