![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| shell script command | lg123 | UNIX and Linux Applications | 3 | 04-11-2008 12:35 AM |
| cd command is not working in my shell script | amitrajvarma | Shell Programming and Scripting | 3 | 10-03-2007 02:04 AM |
| how to use cd command in shell script | LAKSHMI NARAYAN | Shell Programming and Scripting | 3 | 09-09-2007 03:04 AM |
| vi command in shell script | bryan | UNIX for Dummies Questions & Answers | 2 | 05-23-2006 04:51 PM |
| Shell script command | dipanrc | Shell Programming and Scripting | 7 | 11-29-2005 07:15 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
|||
|
Use ftp command in shell script
How can i use FTP Command in a shell script ?
user='user1' password='password1' IP='***.***.***.***' ftp -n $IP 22 <<END_SCRIPT user $user $password exit END_SCRIPT |
| Forum Sponsor | ||
|
|
|
|||
|
Here is the soln
The best ways is to use "sftp"
If you have "ssh-key generation between the client and host server then sftp is the best option. code : sftp $servername <<END_SCRIPT Your code END_SCRIPT If you know concept of key gen then use sftp. keygen establish a connection between 2 server by which u dont need userid and pwd for connection.. |
|
|||
|
Try this
user='user1' password='password1' IP='***.***.***.***' ftp -n -i -v $IP 22 <<-END_SCRIPT > LOG_file user $user $password status bin lcd <DESTINATION DIR> cd <REMOTE DIR> mget *.* bye END_SCRIPT Regards, Pankaj |
|||
| Google The UNIX and Linux Forums |