From owner-freebsd-questions@freebsd.org Wed Dec 9 15:54:24 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 9A08F9D5D81 for ; Wed, 9 Dec 2015 15:54:24 +0000 (UTC) (envelope-from patrickhess@gmx.net) Received: from mout.gmx.net (mout.gmx.net [212.227.15.15]) (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 F10CE1225 for ; Wed, 9 Dec 2015 15:54:23 +0000 (UTC) (envelope-from patrickhess@gmx.net) Received: from desk8.phess.net ([95.88.166.205]) by mail.gmx.com (mrgmx002) with ESMTPSA (Nemesis) id 0LgIWi-1acmA00ew8-00nfsU for ; Wed, 09 Dec 2015 16:54:16 +0100 From: Patrick Hess To: freebsd-questions@freebsd.org Subject: Re: Synchronizing directory hierarchies via SFTP Date: Wed, 09 Dec 2015 16:54:15 +0100 Message-ID: <5475394.tzi9gdkkBP@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> <24246596.8z5VK3yfqz@desk8.phess.net> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:1W9PW+c0oPGS7xYA1l7eFKdDMN0X1Hspn+VroTE59xKD6kHuzmh lTzKH/qyO4jAFRuj5oTMDx7Io0wIO7Wij/Z4FoRm3wlDklutY9a4y9+6yOwMf1GuQOueSEt gAqZAz50zkKX1WwwB5FSSfBuMX5qqNVRnQrSABFgYpqskUQR520HmdiGT9AQV7m1LicppEB x0k8TYBAjcH02MVUgfLVQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:KYlnI5QX5i4=:G8IXv9qWzt43MqX36wT7tS nC5s/69l62SkA1wD0KxHeZ0AJdsIqd/Xn6L3q/prwAS9B6Ye5XiJiIBzMP2VFm5++K1Nswxz6 gwjVytk5K/8yIPQVFQcukALy2Ke7yJswA2iDHuHTHEeKymwY6qlmDm6vftX2RtldMrdTUcmHq qwNkJm5tH+NWUewrOiEFCpC3l9hHcM22UAXLuzsqh4Rie2IlKpNgt6SgERaODQBu9ajw/59oY 87d20ZgiMcJlbvPQSBqvLhf/x9Bx9qvxWio6CYBFzmQocZVSnfal/yBUInfuU4rEdRR8AFdfh qwqb0YdH1giWX9ytAc8Nbg0AssoSSUwLKx1UUY97kxA22h0oEZQN8B2Yed+M/W1sv34c3+3yC fs02OeOR46/3rGcoOjv67VDGBKOQokEtHHmkN6yVMBc6qlLvQxotp1uR/WOz2mQ4vfjrTVe3G eVRB96E1oKSdCrEiYjrHGtN1Vd3SQz53DTTj5pP5j7IUM/73YK9dQicrm2t1U8/JKVuNwKYOt Kv1w7LrNeJtVyWdehndHZJGi7eUBtsrOmuM1qJD1JnZP8897zEFY6XWm5ooHWES1zHlrYrCl/ jXpZKjFGedJ0fKvo9GVInNpkF3T+9Pwvd7GsjvATWcCxZKVYURTiwTy1K2x1tQlGRjNrIORAR DsSIYWRI30UnISBOEQ+GdgJtx+Cr5xvlXxcEZ1zg/llBG7t1q2qVAH7b8x1vJ7rTytb9ytLdl EO/Axc0PFR7t2v/DSsbYaPh6pFk5W3RDBHxr779VaOMEoQBx1gCuRr/7WLABtld+tSEI8f190 vIXcjls 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 15:54:24 -0000 Michael Ross wrote: > You can put it in a file > > #!/usr/local/bin/lftp > open sftp://user:pass@host > mirror -v --reverse --dereference ... Is there an easy way to pass parameters to that file? I'd like to be able to pass in different source and target directories to the mirror command. Meanwhile, I figured out how one is supposed to use the -c option correctly: lftp -c "connect sftp://$SFTP_USERNAME:$SFTP_PASSWORD@$SFTP_SERVER && \ mirror -v --reverse --dereference --delete --overwrite \ --exclude-glob *.swp $LOCAL_DIR $REMOTE_DIR; \ quit" That's at least not as messy as the Expect script. > That gives you about a week before the script actually exits. The way I see it, that gives the server about a week to finally get its stuff together. ;-) Patrick