Subject: Re: ftp upload synchronization tool
To: None <netbsd-help@NetBSD.org>
From: Julian Coleman <jdc@coris.org.uk>
List: netbsd-help
Date: 04/10/2007 16:15:50
> But it can?  
> 
> $ man ftp | col -b | sed -ne '/  mkdir/,/remote/p'
>      mkdir directory-name
>                  Make a directory on the remote machine.

Using .netrc files, you could do something like (/bin/sh syntax):

  REM=remote.machine1.com
  cat > .netrc.$REM << EOC
  machine $REM
  login anonymous
  password me@my.host.org
  macdef init
  cd upload-dir
  mkdir new-dir
  put new-file1
  put new-file2
  quit

  EOC
  ftp -N .netrc.$REM $REM

and watch the results.  If you want to parse the results, you can look at
the NNN codes returned by the ftp server.  If you want to act on the results
of each command, you probably should look at something like lang/tcl-expect
in pkgsrc.

J

-- 
  My other computer also runs NetBSD    /        Sailing at Newbiggin
        http://www.netbsd.org/        /   http://www.newbigginsailingclub.org/