Re: ftp upload synchronization tool

Julian Coleman <[email protected]>
Newsgroups gmane.os.netbsd.help
Message-ID <[email protected]>
> 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 [email protected]
  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/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.