From owner-freebsd-questions@freebsd.org Wed Dec 9 00:13:33 2015 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 737649D4E84 for ; Wed, 9 Dec 2015 00:13:33 +0000 (UTC) (envelope-from patrickhess@gmx.net) Received: from mout.gmx.net (mout.gmx.net [212.227.17.21]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mout.gmx.net", Issuer "TeleSec ServerPass DE-1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B232D1E40 for ; Wed, 9 Dec 2015 00:13:32 +0000 (UTC) (envelope-from patrickhess@gmx.net) Received: from desk8.phess.net ([95.88.166.205]) by mail.gmx.com (mrgmx102) with ESMTPSA (Nemesis) id 0MUCTO-1ZfP4Y1JL8-00R43h for ; Wed, 09 Dec 2015 01:13:24 +0100 From: Patrick Hess To: freebsd-questions@freebsd.org Subject: Re: Synchronizing directory hierarchies via SFTP Date: Wed, 09 Dec 2015 01:13:22 +0100 Message-ID: <24246596.8z5VK3yfqz@desk8.phess.net> User-Agent: KMail/4.14.3 (FreeBSD/10.1-RELEASE-p24; KDE/4.14.3; i386; ; ) In-Reply-To: References: <13761006.QDN0LtKzYl@desk8.phess.net> <5263162.JaugYyUJYb@desk8.phess.net> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:13rk5liHigeJepBj5IuxEYxxKdASMe+Tu+tSWp3PRSNUM5XL63y ansTrEdbzgvsrM8hxLUXmYUl+LeThEPR3kuXcwc9A8rgRuMPSNZNsXPk52Ew69wKTZYnYs1 vVOX5+tRR6rv+hm1Sbpyb/VErRXRR7jyWws1hxvhLWeObFU9G3qZiNb+AzIpJwjCYAHImbl YVau0C0Rl9Xne5c+Btr0w== X-UI-Out-Filterresults: notjunk:1;V01:K0:mc1ZVHXfuZ0=:9L7/qrtUymSl7ld7Zt5bHS cHDzbJGqctvV7IyIkvH7KrXaDBSg0mY5KfbcshmHtWGib2vUOJVbiWqYl4500O8/zy394uFY7 W7Nypigs8KdE4j0wW707vnes/R1pe91aBw4m5uGj+pfBiN3elQkoZ+hDq5DbacHCL2/3sTt/n LNY2et7cWROTn0n3vLEke+31JWZF3R8GeZf6L+nQn9ynUUu2Bm54QD7EvMs/mMQyxcFULaf2m A8gdbFZ1BWQOyhuWepcNdaxfP2Z4jZmjx88/PXtfcWmgwqIN0SIz16Ot3uXRmchTbsDyvnbnq PS9+Eal9D5GY/fztlGmC4rImYpLDnGWuU2EYYG2Bf1AR03DZhB+aO6g73gKweC58GZKOLxS0v 0SkmXx/NHL2iBkKg2DlOTT0UqijY6uCFCxQDsPeS4oazZ6V7/GGrPSYkMAH4yN3cQ95Ntz9y0 apLdySDXaczNVO41720xxbsyRHhxdX9rxtflFEWeApBStrDeyJzMQ0d+Hhn9waYl8/g/J54j1 x7RxRXp3ohD29vYJJlbCQXsLSxEE75xHQidEmyA8FYCxyWoBr5e88WTsZfIF0zppNhwllRC5U OBOgQ9/ycFZPp6v2ex1vKXpr8mZgP0UDn9/VXHU7RM0wEDCEDZ2M8yzUJ0drejkphRbX9AC7s qaUIys2gSWzOo0cCtvQ04vlsFA8gQlHdiIH92Z7v/q/uujoZQcEodlrJmHGPYw/DvjOR60b20 1iROvGrs1vhnOE8cg2i3CVgnh0bpIPfK8umoXgGG+7xgnRlj61JLrph2+2FaAlnkdLMKOf4/c D31CmwJ X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Dec 2015 00:13:33 -0000 Michael Ross wrote: > Am .12.2015, 00:43 Uhr, schrieb Patrick Hess : > > Just came across LFTP, http://lftp.yar.ru. According to the feature list, > > it has support for SFTP and also comes with a "built-in mirror and > > reverse mirror" option. > > lftp is used a lot here to mirror directories via sftp. Would recommend. Tried it today, works like a charm. In comparison to csync, I noticed that the initial directory traversal in particular is a lot faster with LFTP. And since there's still a big question mark behind sshfs regarding its stability on FreeBSD, I'll just settle for LFTP and call it a day. > Check out the fine-tuning available with "set -a". Wow, that's a lot of stuff to mess up... Maybe some other day. So far, the defaults seem to work just fine for me. Patrick PS: Here's the quick'n'dirty Expect script I hacked together, in case someone has a use for it. _______________________________________________________________________ expect -c ' set timeout -1; spawn lftp -u '"$SFTP_USERNAME"' sftp://'"$SFTP_SERVER"'; expect "Passwor\[dt\]:"; send "'"$SFTP_PASSWORD"'\r"; expect "lftp *> "; send "mirror -v --reverse --dereference --delete --overwrite --exclude-glob *.swp '"$LOCAL_DIR"' '"$REMOTE_DIR"'\r" expect "lftp *> "; send "quit\r"; expect eof; ' _______________________________________________________________________