4 Replies Latest reply on Feb 5, 2015 12:22 PM by KevinVandenBrande

    System script does not work

    KevinVandenBrande

      Title

      System script does not work

      Your post

      I created the following shell script as test:

      #!/bin/bash
      folderSource="/Volumes/Macintosh HD/Library/FileMaker Server/Data/Documents/test/"
      folderTarget="/Volumes/Macintosh HD/Library/FileMaker Server/Data/Documents/"

      cd "$folderSource"

      for myFile in *
      do
          myPath="$folderSource$myFile"
          mv "$myPath" "$folderTarget"
          if [ "$?" != "0" ]; then
              syslog -s -l notice "Error when moving file $myFile"
          else
              syslog -s -l notice "Moved file $myFile"
          fi
      done
      # end

      This script i placed inside the scripts folder of the FileMaker server. Whenever I create a new systemscript and I execute this script, I always get an error that the move was not successfull. However when i run this script in terminal it works like charm.

      What is the cause of this problem? I have tried already many variants of this but without success everytime in the FileMaker server