filesync [-aehmnqvy] [-o src | dst] [-f src | dst | old | new] [-r directory]...
filesync [-aehmnqvy] -s source-dir -d dest-dir filename...
If files are synchronized between systems, the corresponding files on each of the systems are identical. Changing a file on one or both of the systems causes the files to become different (not synchronized). In order to make the files identical again, the differences between the files must be reconciled. See Reconciling and Synchronizing Files for specific details about how filesync reconciles and synchronizes files.
There are two forms of the filesync command. The first form of filesync is invoked without file arguments. This form of filesync reconciles differences between the files and systems specified in the $HOME/.packingrules file. $HOME/.packingrules is a packing rules list for filesync and contains a list of files to be kept synchronized. See packingrules(5).
The second form of filesync copies specific files from a directory on the source system to a directory on the destination system. In addition, this form of filesync adds the file or files specified as arguments (filename) to $HOME/.packingrules. See -s and -d for information about specifying directories on source and destination systems. See OPERANDS for details about specifying file (filename) arguments.
Multiple filesync commands are cumulative (that is, the specified files are added to the already existing packing rules file list). See Multiple filesync Commands.
filesync also maintains a baseline summary in the $HOME/.filesync-base file for all of the files that are being monitored. This file lists the names, types, and sizes of all files as of the last reconciliation.
If a source file has changed and the destination file has not, the changes on the source system are propagated to the destination system. If a destination file has changed and the corresponding source file has not, the changes on the destination file are propagated to the source system. If both systems have changed (and the files are not still identical) a warning message will be printed out, asking the user to resolve the conflict manually. See Resolving filesync Conflicts.
In these cases, you must either resolve the differences manually, or tell filesync how to choose which file should win. Use the -o and -f options to tell filesync how to resolve conflicts (see OPTIONS).
Alternatively, for each conflicting file, you can examine the two versions, determine which one should be kept, and manually bring the two versions into agreement (by copying, deleting, or changing the ownership or protection to be correct). You can then re-run filesync to see whether or not any other conflicts remain.
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 create the packing rules file manually and 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 complex wildcard expressions by editing the $HOME/.packingrules file.
If you delete the files from your notebook, filesync will want to perform the corresponding deletes on the server, which would not be what you wanted. Rather, you would like a way to tell filesync to stop synchronizing some of the files. There are two ways to do this:
Either way works, and you can choose the one that seems easiest to you. For minor changes, it is probably easier to just edit $HOME/.packingrules. For major changes it is probably easier to start from scratch.
Once filesync is no longer synchronizing a set of files, you can delete them from your notebook without having any effect on the server.
Each nomadic machine should carry its own packing rules and baseline file. Incorrect file synchronization can result if a server carries a baseline file and multiple nomadic machines attempt to reconcile against the server's baseline file. In this case, a nomadic machine could be using a baseline file that does not accurately describe the state of its files. This might result in incorrect reconciliations.
To safeguard against the dangers associated with a single baseline file being shared by more than two machines, filesync adds a default rule to each new packing rules file. This default rule prevents the packing rules and baseline files from being copied.
Some file systems do not support ACLs . It is not possible to synchronize ACLs between file systems that support ACLs and those that do not; attempting to do so will result in numerous error messages.
-f src | dst | old | new
Specify -f src to favor the source-system file. Specify -f dst to favor the destination-system file. Specify -f old to favor the older version of the file. Specify -f new to favor the newer version of the file.
It is possible to specify the -f and -o options in combination if they both specify the same preference (src and dst). If -f and -o conflict, the -f option is ignored. See the -o option description.
There are instances in which using filesync to update some (but not all) files in a directory will confuse the make program. If, for instance, filesync is keeping .c files synchronized, but ignoring .o files, a changed .c file may show up with a modification time prior to a .o file that was built from a prior version of the .c file.
Specifying both the -n and -o options causes filesync to analyze the prevailing system and report the changes that have been made on that system. Using -n and -o in combination is useful if your machine is disconnected (and you cannot access the server) but you want to know what changes have been made on the local machine. See the -o option description.
-o src | dst
Specify -o src to propagate changes only from the source system to the destination system. Changes made on the destination system are ignored. filesync aborts if it cannot access a source or destination directory.
Specify -o dst to propagate changes only from the destination system to the source system. Changes made on the source system are ignored. filesync aborts if it cannot access a source or destination directory.
Specifying -n with the -o option causes filesync to analyze the prevailing system and reports on what changes have been made on that system. Using -n and -o in combination is useful if a machine is disconnected (and there is no access to the server), but you want to know what changes have been made on the local machine. See the -n option description.
It is possible to specify the -o and -f options in combination if they both specify the same preference (src or dst). If -o and -f options conflict, the -f option will be ignored. See the -f option description.
The standard filesync message describes each reconciliation action in the form of a UNIX shell command (for example, mv, ln, cp, rm, chmod, chown, chgrp, setfacl, and so forth).
If filename is an ordinary file, that ordinary file will be replicated (with the same filename) in the specified destination directory (dest-dir).
If filename is a directory, that directory and all of the files and subdirectories under it will be replicated (recursively) in the specified destination directory (dest-dir).
If filename is a symbolic link, a copy of that symbolic link will be replicated in the specified destination directory (dest-dir).
If filename is a special file, a special file with the same major or minor device numbers will be replicated in the specified destination directory. (dest-dir). Only super-users can use filesync to create special files.
Files created in the destination directory (dest-dir) will have the same owner, group and other permissions as the files in the source directory.
If filename contains escaped shell wildcard characters, the wildcard characters are stored in $HOME/.packingrules and evaluated each time filesync is run.
For example, the following would make sure that the two specified files, currently in $RHOME, were replicated in $HOME:
filesync -s $RHOME -d $HOME a.c b.c
The following example would ensure that all of the *.c files in $RHOME were replicated in $HOME, even if those files were not created until later.
filesync -s $RHOME -d $HOME '*.c'
If any of the destination files already exist, filesync ensures that they are identical and issues warnings if they are not.
Once files have been copied, the distinction between the source and destination is a relatively arbitrary one (except for its use in the -o and -f switches).
|September 8, 2015||OmniOS|