linux shell script using ftp to get a file

common is like this:

path="users/jeffyd/Softwares/Opensource/Maven" 
filename="apache-maven-2.2.1-bin.tar.bz2"
hostname="*.*.*.*"
username="***"
password="***"

date
echo Get $filename From $hostname
ftp -vn $hostname <<EOF
user $username $password

cd $path
pwd

binary
get $filename

bye
EOF

 

another is like this:

path=users/jeffyd/Softwares/Opensource/Hudson/
filename="hudson.war"
hostname="*.*.*.*"
username="***"
password="***"


ftp -un $hostname <<EOF
quote USER $username
quote PASS $password

cd $path
get $filename

quit
EOF

你可能感兴趣的:(apache,maven,linux,OpenSource)