Syncronizing files over FTP

I need to syncronize files in my computer with server to which I have only FTP access. So I can't use rsync (that would need at least SFTP, but the only channel available for me is plain vanilla FTP).

I only need one-way syncronization: from my machine to server. I have heard of a program called unison, but it seems to be meant for two-way syncronisation and I'm unsure whether it could be tweaked to do what I want. I should also add that the program should work non-interactively, so that it could be used inside a script.

Final option would be to write my own script that compares files by modification time (or something like that) and copies over the ones that have changed. I have already managed to mount the FTP directory to a local directory, so the problem boils down to just syncing two directories. But my gut feeling tells me, that there must be something like that already existing in the wild.


Solution 1:

Because I couldn't get wput to work, I looked for an alternative and found: ncftp.

More specifically ncftpput seemed to do almost what wput was designed to do. Most importantly for me, it didn't crash like wput. And indeed it manages to upload only those files that haven't changed using the -z option:

ncftpput -z -u user -p pass ftp.mydomain.com dir/name files-to-upload...

Solution 2:

lftp seems also appropriate here: https://stackoverflow.com/a/693280/480534

Summary:

lftp <username>@<server>
  mirror -c <source> <dest>
  exit

Solution 3:

Sure, and it is called wput