HPE Community read-only access December 15, 2018
This is a maintenance upgrade. You will be able to read articles and posts, but not post or reply.
Hours:
Dec 15, 4:00 am to 10:00 am UTC
Dec 14, 10:00 pm CST to Dec 15, 4:00 am CST
Dec 14, 8:00 pm PST to Dec 15, 2:00 am PST
cancel
Showing results for 
Search instead for 
Did you mean: 

shell script

 
Tape Backup_1
Occasional Contributor

shell script

Hi I want write a shell script for loging thought ftp so pls help me write a programme. am trying to do below things...
touch file in that i have metion the ftp
i dont know how to mention user name and password please help me
9 REPLIES
Prasanth V Aravind
Trusted Contributor

Re: shell script

ftp -i -n <> $mylog
open $FTP_HOST
user $FTP_LOGIN $FTP_PASSWORD
put $localFile $remoteFile
ls $remoteFile
quit
EOF


Gudluck
Prasanth
Tape Backup_1
Occasional Contributor

Re: shell script

Hi Prashanth,

ftp -i -n <> $mylog
open $IP aadress
user $username $username
i have given like above but still is not login any thing else you want me do..

//Chandru.C

Re: shell script

>still is not login:
open $IP_address
user $username $username

Have you defined these 2 shell variables?
Tape Backup_1
Occasional Contributor

Re: shell script

tht is password still not able to login

/Chandru.C
Steven Schweda
Honored Contributor

Re: shell script

As usual, it might help if you showed _all_
the actual commands you're using.

> user $username $username

"$username" twice? Not "$password"?


Using SFTP instead of FTP might remove the
need to specify a password.
Tape Backup_1
Occasional Contributor

Re: shell script

ftp -i -n <> $mylog
open $HOST Name
user $username $PASSWORD

using above shell script we are not able to login please help me resolve

//Chandru.C
Horia Chirculescu
Honored Contributor

Re: shell script

Hello,

Just a thought:

$PASSWORD is not the same as $password

It is case-sensitive.

Best regards,
Horia.

Best regards from Romania,
Horia.
singh sanjeev
Trusted Contributor

Re: shell script

or you can use .netrc file where u can put the server name user password for auto login via ftp.

for more check man netrc. and removed the
user $username $PASSWORD after entrying detail in netrc.

if it is not there then u have to recreate it with

touch .netrc and allocate permission.
Sanjeev Singh
Steven Schweda
Honored Contributor

Re: shell script

> using above shell script we are not able to
> login please help me resolve

Please supply enough useful information to
make that possible for a non-psychic.

> As usual, it might help if you showed _all_
> the actual commands you're using.

Still true.

An actual error message might be nice, too.