- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Remote Copy Putting Wrong File Permissions on Targ...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-15-2001 12:50 PM
тАО05-15-2001 12:50 PM
I couldn't get anyone to answer me, so I started a new tread (hope that's OK - more points).
Anyway, it is creating the file with root and
sys and not syb115 syb115 and I tried the
rcp with and without the -p and it makes no
difference.
It does NOT keep the
same file permissions and owner and group.
It does this:
rw------- 1 root sys 12242402 May 14 21:41 laurie
When it should leave the permissions to the
orginial file:
-rw------- 1 syb115 syb115 460911 May 14 21:00 masterbk1.gz
Anyway clues what I am doing wrong?
Laurie
My Script:
FILES="/db01/syb115/backup/*.gz /db02/syb115/backup/*.gz etc"
for FILE in ${FILES}
do
rcp -p ${FILE} snoopy:${FILE}
done
~
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-15-2001 01:07 PM
тАО05-15-2001 01:07 PM
SolutionActually -p is keeping the correct permissions
along with modification times. It is not keeping ownership - that is a function of the
user invoking the rcp (or remsh) commands.
You have two choices:
1) Set up the desired user as a valid cron user; setup .rhosts (and possibly /etc/hosts.equiv) for that user
or
2) after each rcp -p in your loop
do a remsh snoopy chown syb115:syb115 $FILE
Hope this clears up your problem, Clay
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-15-2001 01:11 PM
тАО05-15-2001 01:11 PM
Re: Remote Copy Putting Wrong File Permissions on Target
The -p option only keeps the "mod" the same. I.E.
755=rwxr-xr-x
A file with the 755 permission bit's set will get copied with 755 permissions as the permissions request is made After the copy.
The problem is who owns the files. By nature a unix file is always owned by the user who created it and their primary group.
If you want that user to own the files on the other system, they will have to be the one who issues the rcp command.
Make sure that the user can rcp data, and the ID exists on the other system. If this is a cron job, make sure to give them and entry in /usr/lib/cron/cron.allow.
If you dont want to do this, then extend your script to remote shell over and chown and chgrp the file to the owner you want when the copy is done.
Hope it helps!
Shannon
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-15-2001 01:18 PM
тАО05-15-2001 01:18 PM
Re: Remote Copy Putting Wrong File Permissions on Target
Peggy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-16-2001 05:37 AM
тАО05-16-2001 05:37 AM
Re: Remote Copy Putting Wrong File Permissions on Target
You might try the following (tested and works)..
#!/usr/bin/ksh
files="/tmp/file1 /tmp/file2"
for file in $files
do
tar cvf ${file}.tar ${file}
rcp ${file}.tar otherhost:${file}.tar
remsh otherhost tar xvf ${file}.tar
remsh otherhost rm ${file}.tar
rm ${file}.tar
done
Might not be the prettiest way, but it gets the job done..:)
Nico van Royen
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-16-2001 06:12 AM
тАО05-16-2001 06:12 AM
Re: Remote Copy Putting Wrong File Permissions on Target
I allways use tar in combination with remsh.
Your need could be filled with the following command :
# cd /db01/syb115/backup
# tar cvf - *.gz | remsh snoopy "(cd /otherdirectory ; tar xvf - )"
I always use such a structure of command, and this gives me the possiblity to copy the files *.gz into another directory on the other machine.
eventualy you can use it without the v (verbose) option of tar.
I once had to copy a lot of ASCII-files (*.log) over a slow WAN-connection, so I used compress to compress the standard output (and uncompress the standard input) :
cd /tmp
tar cvf - *.log |compress| remsh snoopy "(cd /tmp ; cat - | uncompress | tar xf - )"
Greetings,
Chris MARREEL