![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Script for FTPing files to mainframe GDG | dsrookie | UNIX for Dummies Questions & Answers | 1 | 03-13-2008 06:32 AM |
| FTPing from XP to Solaris | dtferreira | UNIX for Dummies Questions & Answers | 3 | 07-12-2007 01:42 PM |
| FTPing from unix box to windows box. | aarora_98 | Shell Programming and Scripting | 8 | 01-25-2007 06:40 AM |
| Error in ftping script | Chanakya.m | Shell Programming and Scripting | 5 | 12-19-2006 01:48 PM |
| FTPing over COM port ??? | badge | UNIX for Advanced & Expert Users | 1 | 04-15-2004 05:59 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Ftping through unix script
Hi all,
I am trying to write a script to connect to remote host and ftp some files there. The problem i am facing is,I dont know how to specify username and password for remote host through scripting. and even if i am able to connect to remote host,then how should i execute commands like mput etc through unix scripting. Please do suggest me, how to write the code for the same. Thanks! |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
Post Here to Contact Site Administrators and Moderators is not an appropriate forum to post this question in, please post in an appropriate technical forum.
Thread moved. |
|
#3
|
|||
|
|||
|
#Try the following script
############################### HOST='10.174.47.132' USER='dbg\\azaveri-a' PASSWD='Pass@word2' cd /usr/Fax a=`echo $p\_1\.txt` b=`echo $q\_1\.txt` ftp -n $HOST <<END_SCRIPT quote USER $USER quote PASS $PASSWD cd post bi lcd /usr/Fax/ prompt off put $a $b quit END_SCRIPT exit 0 ##################################### |
|
#4
|
|||
|
|||
|
Thanks Girish!!
I am able to connect to remote host and also able to ftp the files there. The problem that now i am facing is i want to take the count of files ftped. I have taken the count on local host, say in var1 before ftping. Now i want to take the count on remote host ,say in var2 and want to compare both of them to ensure successful ftp of all the files. Still i am not able to determine the scope of these variables and also how to get value in var2. Looking forward for help, Thanks! |
|
#5
|
||||
|
||||
|
This might help you.
http://www.unix.com/showpost.php?p=3...4&postcount=27 I still have a few things to add, but it does work in its current form. You just need to make sure you have the .sent and .receiving directories on both servers. |
|
#6
|
|||
|
|||
|
Hi ...
Please try the below script .. #!/bin/sh cd /home/user ftp -n 111.222.333.444 <<EOT quote user unixuser quote pass unixuserpass binary cd /TEST put test.txt quit EOT As far unix is concerned you can do ftp to a windows machines ...In the above script if you find any prob please come up with ... Thanks, Arun... |
|
#7
|
|||
|
|||
|
FTP script
This might help
ftp -nv $HOST <<EOF1 user $FTP_ID $FTP_USR_PASSWD lcd $target_dir cd $source_int_dir $TRANSFER_METHOD get $file_name quit EOF1 here store your user id ,password and file name in variables which you will ftping to the remote server denoted by $HOST |
|||
| Google The UNIX and Linux Forums |