How do I use the tool from the command line? |
Fork Server Helper can be used from the command line, e.g. to launch it remotely on a "headless" server, using it in Unix scripts, or running it in the background when the computer is started. The core features of the application are built into the command processForks which can be used without graphical user interface. The executable can be found inside Fork Server Helper's bundle. To locate it, use the following relative path:
ForkServerHelper.app/Contents/Resources/processForks
The synopsis of the command is as follows:
processForks [-split | -combine] [-perm <uid> <gid> <mode>] [-D <minutes>] <directory>...
For each specified directory, the command will process the files according to the options given: -split is equivalent to the feature generate additional AppleDouble representations from resource forks, -combine is equivalent to the feature create resource forks from AppleDouble and Services for Macintosh representations. If then -perm option is set, the command will modify permission settings. UID, GID and Unix file mode have to specified numerically. To run the command in the background, add the option -D with the activation interval in minutes.
Note: The -D option is not supported in Mac OS X 10.5 or later.
Example: The command
processForks -combine -perm 501 20 486 -D 3 /Volumes/Shares/A
will recreate resource forks for all files in the folder /Volumes/Shares/A running in the background with an activation interval of 3 minutes. The user is set to UID 501, the group to GID 20 and the mode to decimal 486 which is equivalent to octal 0644 (= rw-r--r--, see man chmod for more information about specifying file modes by number).
To make sure the command has the required privileges to run in the background and to change permission settings you must run it as "root" user. This means you should call the command from a script that is running with root privileges, or use sudo to run it.
In case of problems, the command will send error messages to the standard error channel. If the command was started with the -D option, messages are sent to the system message logger. Upon return, processForks uses the following exit codes:
0 - the command was executed successfully, 1 - there was an error in the command line arguments, 2 - a permission problem was detected, 3 - another error occurred.