Hi folks, Some one know who create a FTP script under HP-UX 11..? and who pass parameters, a mean, for example, I need to pass the file name for transport this file to another server.
Thanks a lot
Eduardo Medina
Juarez , Mexico
#!/bin/sh ftpput () {
remotehost=$1
username=$2
password=$3
filename=$4
{ echo "open $remotehost
user $username $password
hash
cd /remote/directory
put $filename
close"
} | ftp -i -n -v 2>&1 | tee /tmp/ftplog
}ftpput hostname username password filetosend
You can use this document to script an FTP file transfer. The basic idea is shown here.
ftp -i -v -n ftp.keekar.com (redirector} end_ftpuser keekar mypasswordbinary
lcd /scripts/download
cd /scripts
get auto_ftp_xfer.ksh
bye
END_FTP
There are two ways 1. First method is
#!/bin/sh
ftp -n localhost <<!
quote user YourUserName
quote pass YourPassword
binary
put file1 file2
quit
!
1. Second method isftp -n -i -v ftp.url.com <<!
user username password
cd /data/shared/
lcd /data/import
mget vcm*.dat
bye
!
| « Need to find the string | Script running or not » |