next up previous contents
Next: sftp: secure FTP Up: Transferring Files Between Systems Previous: quit:   Contents

.netrc: FTP in batch

File
.netrc
in your $HOME directory allows file transfers in batch mode. Permission on that file should be 600 (rw----); it will likely not work otherwise.

Each record has the format:

machine machine login login password passwd
where each of machine, login and passwd refer to a system name with the login and password for that account on the machine.

Typically, this is used to do anonymous FTP transfers, so an entry could look like:

machine nrcnet0 login anonymous passwd cantin@nrc.ca

FTP commands to be used would then be put in some file, and the command to be executed would be similar to

ftp machine $<$ filename
where the content of filename could look like
bin
cd /pub
get README
quit



Claude Cantin 2010-10-24