1830895 Members
1472 Online
110017 Solutions
New Discussion

rcp / rcp -p / remsh

 
SOLVED
Go to solution
ikbea
Frequent Advisor

rcp / rcp -p / remsh

Hi all,

For HPUX 10.20

Do rcp, rcp -p, remsh use
1. /etc/profile
2. $USER_HOME_DIR/.profile
3. umask
in source and destination/remote servers?

What's the different between rcp & rcp -p ? I used rcp/rcp -p to copy file to a remote server: the mode and ownership are same at remote server. The umask are 022 in source and destincatin server.

Thanks
5 REPLIES 5
Rajeev  Shukla
Honored Contributor
Solution

Re: rcp / rcp -p / remsh

rcp,rcp -p or remsh do not use either /etc/profile, $USER_HOME_DIR/.profile or UMASK.
ALso rcp -p preserves the permission and ownership of the file
ikbea
Frequent Advisor

Re: rcp / rcp -p / remsh

I tested rcp and rcp -p

<>
Server A
========
mode of file1 and file2 = 666
rcp file1 ServerB:/home
rcp -p file2 ServerB:/home

Server B
========
mode of file1 and file2 = 666

<>
Server B
=========
Remove file1 and file2

Server A
========
mode of file1 and file2 = 660
rcp file1 ServerB:/home
rcp -p file2 ServerB:/home

Server B
========
mode of file1 and file2 = 660

<>
Server B
=========
Remove file1 and file2

Server A
========
mode of file1 and file2 = 664
rcp file1 ServerB:/home
rcp -p file2 ServerB:/home

Server B
========
mode of file1 and file2 = 664

Why rcp also reserve mode ?
Thanks
Vibhor Kumar Agarwal
Esteemed Contributor

Re: rcp / rcp -p / remsh

Check whether the date stamps are preserved with rcp or not.

I think they will be with rcp -p
Vibhor Kumar Agarwal
Mahesh Kumar Malik
Honored Contributor

Re: rcp / rcp -p / remsh

Hi shiv

rcp -p option can be used to preserve (duplicate) modification times and modes (permissions) of source files, ignoring the current setting of the umask file creation mode mask. If this option is specified, rcp preserves the sticky bit only if the target user is superuser.If the -p option is not specified, rcp preserves the mode and owner of dest_file if it already exists; otherwise rcp uses the mode of the source file modified by the umask on the destination host. Modification and access times of the destination file are set to the time when the copy was made.

Regards
Mahesh
ikbea
Frequent Advisor

Re: rcp / rcp -p / remsh

I also tested remsh (echo a > testfile), mode of output file = 666

Is there any offical doc (e.g. from HP) indicated that remsh do not call /etc/profile, /$USER_HOME_DIR/.profile ?

and can remsh set umask ?

Thanks again