The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com




Thread: FTP automated?
View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #2 (permalink)  
Old 05-09-2001
mib mib is offline
Registered User
  
 

Join Date: Jan 2001
Location: Calicut
Posts: 228
You can create a file called ".netrc" in your home directory. Put these line in .netrc file:

machine servername login username password passwordhere

When it's done, create a file (we will call it "ftpcommands")
that contains the commands. For example:

cd /ftp/directory
put yourfile
bye

and call it:
# ftp servername < ftpcommands

or

#!/bin/bash
#autoftp.sh
ftp machine < ftpcommand

# ./autoftp.sh

Note: chmod 400 .netrc

You can also use "expect". man expect for more info


HTH