Copy all files from "files" to an FTP account

Can anyone tell me how to do a script so i can copy the contents of “files” to and FTP server, Please ?

Do you want to do an FTP put command from the Tik?


I would recommend the easiest way is to get a FTP pull application or a FTP client that can frequently check the device for changes?

I ran into an intermittent problem with a scheduled ftp client uploading files to RB1100’s. It sometimes fails to connect or it will connect and then reject the upload, and/or other wierdness. The automation is done with a “dumb” batch file and auto-generated text file for the ftp commands.

This method is a problem because it is unable to react to any errors. I looked around and found “WinSCP” which is an open source scriptable ftp client. I haven’t had time to try it yet, but it might solve both of our problems.

As long as all files are in the root, something like this should work:

:local FTPserverAddress "192.168.88.2";
:local FTPuser "myUser";
:local FTPpass "myPass";
:foreach FILE in=[/file find] do={
  :local name [/file get $FILE name];
  /tool fetch address="$FTPserverAddress" src-path="$name" user="$FTPuser" mode=ftp password="$FTPpass" upload=yes;
}

http://wiki.mikrotik.com/wiki/Manual:Tools/Fetch#Examples
As far as I know you cannot create directories on the FTP server, so copying directory structures via push is impossible.