From owner-freebsd-questions Sun May 20 23:24:49 2001 Delivered-To: freebsd-questions@freebsd.org Received: from exchange.twowaytv.co.uk (exchange.twowaytv.co.uk [194.6.2.173]) by hub.freebsd.org (Postfix) with ESMTP id B32B937B424 for ; Sun, 20 May 2001 23:24:45 -0700 (PDT) (envelope-from ADyas@twowaytv.com) Received: by exchange.twowaytv.co.uk with Internet Mail Service (5.5.2653.19) id ; Mon, 21 May 2001 07:21:37 +0100 Message-ID: <911D8F660DF6D411B61F00500462BA017755F8@exchange.twowaytv.co.uk> From: Alex Dyas To: freebsd-questions@FreeBSD.ORG Subject: RE: FTP shell script Date: Mon, 21 May 2001 07:21:36 +0100 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2653.19) Content-Type: text/plain; charset="iso-8859-1" Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Doug, I think this may solve you problem: #!/bin/sh ftp 10.10.10.10 2>&1 < Basically, between the two '!' characters you can put anything you would normally type in an interactive FTP session. This requires a .netrc on the local machine with the appropriate login privs for the remote machine. alex.. > Hi, > > I need to have a scrip zip up a directory periodically, and > ftp it to a > microsoft version ftp server. The zip part was a snap. But > I can't seem to > get anywhere with the ftp part. > > 1st, here is the last script I tried: > > #! /bin/csh > > zip -r /home/wwwroot/mrtg-backup.zip > /home/wwwroot/vhosts/mrtg.apc.net/* > ftp ftp://myusername:mypassword@ftp.apc.net > put mrtg-backup.zip > by > > OK, now clearly, this is wrong as 1) the following line are > never passed to > the ftp server, but what has really been frosting me is 2) a > problem with > passive transfers. > > The ftp server I'm ftping to doesn't allow passive transfers > (goes REAL > SLOW--really useless when trying to do passive), but when I > execute that > script, it automatically enables passive transfers for the > session. I have > searched and searched for a .netrc, but found none to turn that off. > > I know that at the command line, I can type passive, then it > will disable > passive mode, but only for that session, and not in my script. Since > passive is default, I tried passing the -p in the initial ftp > line, but that > only requested it! > > Anyone got any ideas? > > Thanks! > > Doug. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message