One of the features of the cachefspack command is the ability to pack packing lists. This saves the time of having to specify each individual file that you want packed in the cache.
A packing list contains files or directories to be packed in the cache. If a directory is in the packing list, all of its subdirectories and files will also be packed.
To create a packing list, open a file by using vi or the editor of your choice. The packing list file format uses the same format as the filesync command. See filesync(1) for more information.
The following example shows the contents of a packing list file.
BASE /home/ignatz LIST plans LIST docs IGNORE *.ps |
The path identified with the BASE statement is the directory where you have items you wish to pack.
The two LIST statements identify specific files within that directory to pack.
The IGNORE statement identifies the file type of .ps, which you do not wish to pack.
To pack files using the packing list, use the cachefspack -f command, as follows:
$ cachefspack -f packing-list |
This means you want the software to read the packing list and pack files based on the information specified in the packing list.
-f |
Specifies that you want to use a packing list. |
packing-list |
Specifies the name of the packing list. |
This examples uses the list.pkg file as the packing list for the cachefspack command.
$ cachefspack -f list.pkg |
To specify that one or more files in the packing list should be treated as regular expressions (not as literal file names), use the -r option with the -f option of the cachefspack command. The -r option cannot be used alone.
$ cachefspack -rf packing_list |
where packing_list contains a LIST command defined as follows:
LIST *.doc |
-r |
Specifies that you want the file or files defined in the LIST command treated as regular expressions, and not as literal file names. |
-f |
Specifies that you want the packing list packed in the cache. |
packing_list |
Indicates the name of the packing list that contains the LIST command with the file or files you want treated as regular expressions. |
The following example shows the packing list list.pkg specified to be packed in the cache. list.pkg contains a LIST command that defines a regular expression.
$ cachefspack -rf list.pkg |
The software will pack the file list.pkg into the cache and treat the file names defined in the LIST command as regular expressions, and not as literal file names.
To pack files from a shared directory, and to ensure that you pack only those files that you own, define the LIST command within the packing list file as follows:
LIST !find . -user your_user_name -print |
Pack the packing list in the cache using the cachefspack -sf command.
$ cachefspack -sf packing_list |
-s |
Adjusts the output of the find command to be suitable for the packing list. |
-f |
Specifies a packing list to read. |
filename |
Specifies the name of the packing list to read. |
The -s option must be used with the -f option. The -s option cannot be used alone.
The following example shows how to define a LIST command in the packing list to pack only the files from the base directory that you own:
LIST !find . -user jones -print |
The following example shows how you would then specify packing the packing list.
$ cachefspack -sf /projects/proj_1 |