Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 7312 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

Hi,

FileMaker Server 5.5

I've currently got an overnight scripted FTP backup of our database setup and it works ok.

I was wondering if anyone else here had a backup running through FTP?

What tools in windows did you use to script it?

Basically I run a local backup of the databases then trigger an external script to run.

I use a free scripting engine called AutoIt and basically I just send keystrokes to the windows ftp command-line program - but this tends not to be very reliable. Not very good for an offsite backup!!

If there's any kind of error there's no way for my script to recover - and there's no way using AutoIt for me to get the error or result from the ftp command line program.

Has anybody used WinBatch? Will that do this kind of thing more accurately?

I've seen it used to accomplish all kinds of internet/network related scripting tasks.

What tools/programs/utilities have other people used to accomplish this?

Thanks

Ben

Posted

AutoIT and WinBatch add a lot of overhead to simple scripting tasks. Windows has two native scripting languages: batch files and VBscript. You can do an FTP with either of them.

Type ftp --help at the command prompt for a list of options. One of the interesting ones is the '-s' switch that lets you specify a file with ftp commands . This is called a scenario.

If you need a lot of error checking you can roll all of this in a VBscript so you can check the responses from the ftp server and act accordingly. That you can not easily do with WinBatch and AutoIt.

Posted

The closest I've come to a degree of error checking with autoit is to check the text of the current window to make sure the remote FTP server welcome text was displaying.

If you specify an external ftp command file, presumably the commands aren't all sent at once? The script waits until the ftp server is ready to accept another command?

The problem I have with autoit is that I've had to try and judge the delay between each command in seconds - so I tell the autoit script to send some keystrokes, then wait for a few seconds, then send more keystrokes.

I think the ftp external file might be the answer.

Thanks

Ben

Posted

I use the -s: option to run FTP commands all the time with great success. The FTP client does wait until the server responds before sending the next command, so it won't "overrun" the server. I use FileMaker itself to build the command file on the fly, and make the command file double as a batch file that calls itself so the whole thing is self-contained. I've attached an example.

If you want better error handling, you might try something like cURL or wget instead of using the command line FTP client. Both can do FTP uploads and downloads, and provide slews of options and intelligent error codes. cURL is made for individual file transfers, wget is more directory oriented.

ftpscript.bat.txt

Posted

The Windows version of the shell plugin is great, but there's one caveat. It will only return the results of your command when the command has completed. So if the program you run requires any sort of user interaction (error message prompts, etc) it will just sit there, seemingly locking up FileMaker. If that happens, you have to kill the spawned process to regain control of FileMaker.

This topic is 7312 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.