Bash script to FTP exported files from FileMaker Server

The below bash script can used if you need to FTP an export from FileMaker Server to anywhere.  The script basically looks to see what ever document is in the Documents folder of FileMaker Server and passes that to the cURL command.  It then moves the file to clear it out the directory.  You can /should include error trapping and maybe setup subdirectories but my objetive is to keep this simple to convey the concept after which you can “go nuts” customizing it.

cd /Volumes/Server\ HD/Library/FileMaker\ Server/Data/Documents/
curl -T /Volumes/Server\ HD/Library/FileMaker\ Server/Data/Documents/"$LOCALFILE" --user username:password
mv "$LOCALFILE" /Volumes/Drivename/uploads/

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.