![]() |
|
|
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 |
| problem with dd command or maybe AFS problem | Anta | Shell Programming and Scripting | 0 | 08-25-2006 11:10 AM |
| SSH Problem auth problem | budrito | UNIX for Advanced & Expert Users | 1 | 03-17-2004 10:12 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Help me please on my problem
I basically just need to transfer one file from one server to another.
So I first have to go to this server and with the user name and pass go to their directory and transfer it to another server with a diff user name and pass and paste it there. I have this. #!/bin/sh HOST='directoryofserver2' USER='yourid' PASSWD='yourpw' FILE='file.txt' ftp -m $HOST >> END_SCRIPT quote user $user quote pass $passwd put $file END_SCRIPT EXIT 0 I know I'm doing something wrong since nothing is being copied. how to solve this, help please |
|
||||
|
#!/bin/sh
HOST='directoryofserver2' USER='yourid' PASSWD='yourpw' FILE='file.txt' ftp -m $HOST >> END_SCRIPT quote user $user quote pass $passwd put $file END_SCRIPT EXIT 0 I think you are trying to use END_SCRIPT to denote the end of the ftp stream. Then you must use '<<' and not '>>'. Try this out and see if it helps |
|
||||
|
Hi,
Have used the following script for ftp automation. Hope this'll help you. #########################3 #!/bin/bash USER=anonymous PASS=redhat ftp -i -n << END open <IP_ADDRESS> user $USER $PASS cd pub get file1.txt bye exit 0 Regards, Vinod. |
|
||||
|
o
It's more of a problem of switching servers.
You see my script will be saved in the server hkhpdv13 under the directory of lets say dir/sample, my problem stems from transferring it to another server let's say hkhpdv15 in that servers directory dir2/sample should I first get the file from hkhpdv13? and save it to some file? I'm not familiar in how to switch directories inside a script |
|
||||
|
So in your case, the script can run on Server hkhpdv13.In your case scp command be:
Code:
scp -p /dir/sample/file1.txt hkhpdv15:/dir2/sample/file1.txt If the servers need to be switched and if they are in a file: Code:
for i in server.txt do scp -p /dir/sample/file1.txt $i:/dir2/sample/file1.txt done Hope this helps! nua7 |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|