![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | 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 and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Sar Issue | lbreddy | SUN Solaris | 2 | 01-28-2009 09:33 AM |
| HP-UX Issue!! | Ham | HP-UX | 1 | 05-16-2008 10:18 PM |
| Unix Arithmatic operation issue , datatype issue | thambi | Shell Programming and Scripting | 23 | 02-19-2008 07:19 AM |
| GUI issue | ravi raj kumar | UNIX for Advanced & Expert Users | 1 | 02-18-2008 10:56 AM |
| An issue with SSH | chakri.penguin | UNIX for Advanced & Expert Users | 1 | 11-09-2005 10:49 AM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
FTP Issue-Help
Hi all,
I am trying to transfer files from one server to another. Following is script i wrote for this purpose. It downloads the file to the server which the script is residing and uploads it to the remote server. Main Script Code:
#!/bin/bash -x BOADIR=/ftp/nas1/csg/public/acct/fleet1/outbound SNDIR=/ftp/nas1/csg/public/acct/austintet/inbound/ RAHULHOME=/home/rahul1 CSGDRPFLDR=/home/ftpora/export/temp IP="192.168.191.130" HOST="-i /root/.ssh/id_dsa_noauth 192.168.191.130" ################################################## sleep 10 cd $BOADIR su - rahul1 -c "/usr/bin/scp -p rahul1@ssa001-fe:$CSGDRPFLDR/A900-STEEL* ." sleep 2 cd $FLEETHOME mv A900* $BOADIR su - rahul1 -c "/usr/bin/ssh rahul1@ssa001-fe "cd $CSGDRPFLDR; /bin/rm -f $CSGDRPFLDR/A900-STEEL.test*"" sleep 1 FILES_TO_MOVE=/tmp/baofiles cat /dev/null > $FILES_TO_MOVE find $BOADIR -name "A900-STEEL*" -maxdepth 1 -type f > $FILES_TO_MOVE if [ -s $FILES_TO_MOVE ] then ./boa.sh sleep 20 else echo "No files to move" exit 0 fi script that calls ftp command using the expect function-./boa.sh Code:
set timeout -1 spawn /usr/bin/sftp -b /ftp/nas1/csg/scripts/boaBatchFile tuxidow@ftpaccess.rahul.com match_max 100000 expect -exact "Connecting to ftpaccess.rahul.com...\r tuxidow@ftpaccess.rahul.com's password: " send -- "625XHU14\r" expect eof The batch files which tells what to ftp-boaBatchFile Code:
cd /NEARFAZE mput /ftp/nas1/csg/public/acct/fleet1/outbound/A900-IRON* quit Following are the trials i did and the results got Code:
root@xxxx03 scripts]# telnet ftpaccess.rahul.com 22 Trying 171.161.160.119... [root@xxxx03 scripts]# [root@xxxx03 scripts]# /usr/bin/sftp -b /ftp/nas1/csg/scripts/boaTestFile tuxidow@ftpaccess.rahul.com Connecting to ftpaccess.rahul.com... Can anyone suggest a method to troubleshoot this with out changing much of the script. Last edited by Tuxidow; 02-11-2009 at 08:49 AM.. |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|