If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Unix Shell Scripts > Linux to Unix copy files

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-29-04, 00:49
jaymahesh jaymahesh is offline
Registered User
 
Join Date: May 2004
Posts: 3
Linux to Unix copy files

Hello

Let me declare that I'm a newbie to Unix shell.

We have a Linux server and many Unix stations. I know how to mount/umount and NFS between Linux and the Unix machines.

However I do not know how to copy a file/directory from Unix (hostname: sci_h12) to Linux m/c (host name in the n/w: e90testserver). I can FTP, Telnet into the Linux box but CANNOT copy files which, I think would be good to code into the shell script. 'rcp' command does not work saying 'connection refused', even though I tried with and without /username=<> /password=<>.

Could anyone let me knwo the reason and steps/commands to solve this problem?

Thanks!
Mahesh
Reply With Quote
  #2 (permalink)  
Old 05-30-04, 16:53
fla5do fla5do is offline
Registered User
 
Join Date: Oct 2003
Location: Germany
Posts: 138
Quote:
Originally Posted by jaymahesh
Hello

Let me declare that I'm a newbie to Unix shell.

We have a Linux server and many Unix stations. I know how to mount/umount and NFS between Linux and the Unix machines.

However I do not know how to copy a file/directory from Unix (hostname: sci_h12) to Linux m/c (host name in the n/w: e90testserver). I can FTP, Telnet into the Linux box but CANNOT copy files which, I think would be good to code into the shell script. 'rcp' command does not work saying 'connection refused', even though I tried with and without /username=<> /password=<>.

Could anyone let me knwo the reason and steps/commands to solve this problem?

Thanks!
Mahesh
Hi,
every OS use the the same commands for FTP.
/
ftp xxx.xxx.xxx.xxx IP or [uname] written in /etc/hosts
enter username and password *1
get or mget [filename] : will send the remote-file to your local direktory
put or mput [filename] : will send the local-file to the remote directory
quit : exit the ftp-session

*1 if you dont want to give user and pass for every ftp-login again :
- look at the tread : ftp without a username and password
__________________
Greetings from germany
Peter F.

Last edited by fla5do; 05-30-04 at 17:37.
Reply With Quote
  #3 (permalink)  
Old 06-01-04, 13:11
skd skd is offline
Registered User
 
Join Date: Sep 2003
Posts: 71
try scp ( preferred to rcp) like below and see if this works,
assuming you have access to both machine.


scp sci_h12:/home/user1/dir1/file1 e90testserver:/home/user1/dir2/file2

if it complains , see what is auto path for scp by using 'which scp' at unix prompt and then use absolute path for scp in above command.





Quote:
Originally Posted by jaymahesh
Hello

Let me declare that I'm a newbie to Unix shell.

We have a Linux server and many Unix stations. I know how to mount/umount and NFS between Linux and the Unix machines.

However I do not know how to copy a file/directory from Unix (hostname: sci_h12) to Linux m/c (host name in the n/w: e90testserver). I can FTP, Telnet into the Linux box but CANNOT copy files which, I think would be good to code into the shell script. 'rcp' command does not work saying 'connection refused', even though I tried with and without /username=<> /password=<>.

Could anyone let me knwo the reason and steps/commands to solve this problem?

Thanks!
Mahesh
Reply With Quote
  #4 (permalink)  
Old 06-03-04, 02:18
jaymahesh jaymahesh is offline
Registered User
 
Join Date: May 2004
Posts: 3
Re: Linux to Unix copy files

Hi All

Thanks. While I'll try the 'scp' method, I've meanwhile found another way to solve this problem, without risking the security of rlogin or rcp. Basically what I did using the shell script is:

1) Make dir in Unix(sci_h12) called /server, give full permission to it.
2) mount from Unix/server onto my Linux path (e90testserver)
3) Get PGM_NAME and PGM_PATH
4) Use the above variables to copy cp -r Unix/PGM_PATH/PGM_NAME to Unix/server (dir which mounted earlier to Linux)
5) Unmount Linux box
6) rmdir Unix/server

Tha above runs well as script pgm and when I later check in Linux box's path I find the whole dir (PGM_PATH/PGM_NAME) in it.

Regds
Mahesh
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On