Friday, August 13, 2010

how to sync ftp directory with a local directory in linux [part 2]

I did some more research and found out that lftp can accomplish my requirement!

All you have to do is to pass the following options to lftp : "-c -e"

Here is an example.  I have a file ~/main.conf:

open ftp.somehost.com
user someuser@somehost.com somepassword
set ftp:ssl-allow no
mirror -c -e
exit

I also have another shell script to call lftp with proper configuration, lftp-mirror.sh:

#!/bin/zsh

cd ~/projects/somehost-ftpdir
lftp -f ~/main.conf

I then call lftp-mirror.sh everytime I want to sync my local directory with the ftp server.

Please see previous blog post:

how to sync ftp directory with a local directory in linux [part 1]


0 comments:

Post a Comment