Testing on FileMaker Server box

Playing around with simple shell scripts is a means of establishing the correct paths and permissions etc. before a final, and more complicated shell script is written. In practice, a number of factors need to be included in teh script to check if the target is mounted, check for false moiunts, demount false mounts, and mount the target...

  1. Create the shell script file using Smultron (or TextWrangler)
    The easy way to parse the path is to open terminal, and drag the source directory onto the terminal window. This will enter the full path at the prompt. Then just copy and paste the parsed path into the text editor. The example uses a directory named 'Hourly' as the source, and specifies the destination as ?
  2. check the permissions (executable) using BatChod
  3. create a new plist file using Lingon and configure it to run the shell script file, and specify what time frequncy the shell script should be run.
  4. place file: in the dialogue resulting from new, select User Agents (launched when anyone logs in)
  5. enter a name: com.cortical.bupLaunchd (naming should follow this convention; substitute 'cortical' for something relevant.
  6. what: click Choose to locate the (appropriately permissioned) shell script file
  7. when:
    • check keep it running all the time no matter what happens
    • Run when it is loaded by the system (at startup or login)
    • run it every (2) minutes (for testing)
  8. check that enabled is checked
  9. save it
  10. enter password at the prompt to allow auto-open to make changes
  11. ok the Lingon prompt to restart/re-login
  12. logout (or restart) to apply changes
  13. monitor the destination file creation/modification time to confirm the cycling.

FileMaker Server

Because the FileMaker directory on the server has a space character in the directory name string (FileMaker Server) the space needs to be escaped in the shell script. This can be done either by enclosing the directory name in quotes (“FileMaker Server”), or using a backslash immediately before the space character ( FileMaker\ Server)

the shell script with escaped path is either this:

ditto -c -k -rsrc /Library/FileMaker\ Server/Data/Hourly /Volumes/xsrv/Users/Shared/fms_backups/`date +%y-%m-%d`_hr.zip

or this:

ditto -c -k -rsrc /Library/“FileMaker Server”/Data/Hourly /Volumes/cortex/Users/Shared/fms_backups/`date +%y-%m-%d`_hr.zip