Operating System - HP-UX
1833875 Members
1896 Online
110063 Solutions
New Discussion

rcp change file permission

 
SOLVED
Go to solution
hangyu
Regular Advisor

rcp change file permission

I have two hosts ( host A & host B ) , a file ( permission is 644 ) is copy from host A to host B , If I want the file change to 666 automatically once the was copy to host B , except run another cron job ( eg. * * * * * chmod 666 file ) , can advise what can I do ? thx
3 REPLIES 3
Rajeev  Shukla
Honored Contributor
Solution

Re: rcp change file permission

I am afraid you cant do this.
The only way is to add another line in your rcp script to do a remsh and change the file permission on the destination file after a successfull rcp
freddy_21
Respected Contributor

Re: rcp change file permission

Hello Hangyu,

try to use tar first the file at host A. after that extract to host B.


thanks
freddy
Yang Qin_1
Honored Contributor

Re: rcp change file permission

First of all, you should not use 666 for a file, it is not secure at all. In fact rcp is not secure as well.

rcp user1@HostA:/xxx/yyy/file1 /aaa/bbb/file1;chmod 666 /aaa/bbb/file1

Yes, it two commands, but you can put them in one line so you do not need second cron job.