Sponsored Content
Full Discussion: rcp not working?
Top Forums Shell Programming and Scripting rcp not working? Post 302671253 by mrskittles99 on Friday 13th of July 2012 09:50:08 AM
Old 07-13-2012
rcp not working?

I'm trying to copy a file from a remote unix box, host1, to my unix box, host2. The first line of code gets the last word from a text document (this is the name of the file I need from host1)

Code:
#!/usr/bin/ksh
tail -1 Report.txt | perl -e '@arr = split /\//,<>; lastWord = $arr[-1]'
rcp host1:/tmp/$lastWord .


I get the following error:

rcp: /tmp: not a plain file

rcp is trying to copy the whole /tmp directory for some reason. I need just the 1 file.

Last edited by mrskittles99; 07-13-2012 at 11:01 AM..
 

10 More Discussions You Might Find Interesting

1. HP-UX

rcp logs

Hi, Can anyone help me to trace who has made rcp to a HP-UX machine? Is there a file that keeps such records? I know ftp's are recorded in /var/adm/syslog but i only need rcp.Thanks... (0 Replies)
Discussion started by: ilkergu
0 Replies

2. UNIX for Dummies Questions & Answers

Rcp

I am trying to set up RCP so root can access a few machines for file transfer. On the target machine, I have set up a .RHOSTS file that looks like: 10.33.1.59 root However when I try to use RCP to copy a file to this machine, I get permission denied. Is it possible since another user is... (1 Reply)
Discussion started by: hshapiro
1 Replies

3. Solaris

rcp not working

I applied patch 108993-65 on two servers (5.8) and now I am unable to rcp to either machine. Getting "permission denied". (3 Replies)
Discussion started by: shorty
3 Replies

4. HP-UX

rcp command

Hi, Good day to you all. I am trying to use rcp command to transfer some files on the remote machine. I have already setup .rhosts on my server and on the remote machine. When I do rcp I get this error message rcmd_af: Lost connection Is anybody familiar with this one? Thanks in advance. ... (3 Replies)
Discussion started by: sodapop
3 Replies

5. UNIX for Advanced & Expert Users

Regd: rcp

Hi, The B machine is using rcp method to copy a file to A machine. But it is not getting copied. Its giving the error as: remshd: Login incorrect. On A machine rhosts file has details about the B machine. Could anyone tell what could be done to make this work? Any help is appreciated.... (1 Reply)
Discussion started by: nehak
1 Replies

6. UNIX for Dummies Questions & Answers

RCP Failure

I HAVE A PERL SCRIPT WHICH RCP files from one server to another. The script is not having any issues for years and it is running for more than 3 years . Last week it had failed with error "Command timed out " error. Please help me out (2 Replies)
Discussion started by: praviper
2 Replies

7. UNIX for Dummies Questions & Answers

RCP command

hi, When i use RCP command to copy filr from a different servers, it is showing as connection refused??? ca anyone help me out??? thanks, Arun Manas:b: (2 Replies)
Discussion started by: arunmanas
2 Replies

8. HP-UX

rcp command is not working in crontab

Dear Friends, I am trying to copy SAP log file from one HPux server1 to another HPux server2 remotely through one script. following command has written in the script. rcp -rp /oracle/PRD/sapreorg/*.dbf oraprd@drsite:/oracle/PRD/sapreorg Above command working fine from command mode.... (5 Replies)
Discussion started by: BPANDEY
5 Replies

9. Shell Programming and Scripting

rcp -r || cp -r

what different between two instruction cp -r rcp -r (1 Reply)
Discussion started by: tamer11007
1 Replies

10. Solaris

Rcp issue

Hello, Could anyone help me in explaining what the below command actually means? rcp file_name user_name@ukpm01:cgiprod:file_name1 I know the rcp format as:- rcp filename username@servername:directory_location But what to do with multiple colons? I am on SunOS Solaris... (2 Replies)
Discussion started by: shubh05
2 Replies
LCP(1)							    BSD General Commands Manual 						    LCP(1)

NAME
lcp -- Secure remote file copy SYNOPSIS
lcp [-fvn] [[user@]host1:]file1 [[user@]host2:]file2 DESCRIPTION
lcp is a program that securely copies files between two hosts on a network. This is intended as a secure replacement for rcp(1). Note that both the source and the destination can be on remote machines. OPTIONS
Available options: --help Show summary of options. -f, --force Overwrite existing files. -v, --version Display commands before they are executed. -n, --dry-run Don't execute any commands. Implies -v. ENVIRONMENT
LSFTP_RSH The program to use for the SSH tunnel. If the variable is not set, lcp defaults to using lsh. REPORTING BUGS
Report bugs to <bug-lsh@gnu.org>. AUTHOR
The lsh program suite is written mainly by Niels Moller <nisse@lysator.liu.se>. This man-page was written for the Debian GNU/Linux system by Charles Fry <debian@frogcircus.org>. SEE ALSO
rcp(1), scp(1), lsftp(1), lsh(1), lshd(8) BSD
November 8, 2005 BSD
All times are GMT -4. The time now is 08:43 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy