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