Copy and keep owner info


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Copy and keep owner info
# 1  
Old 08-23-2001
Data Copy and keep owner info

I need to copy all fiels and directories to another locathon and keep the owner info and rights.

I tried cp -r - p * /newdir

No good.
# 2  
Old 08-23-2001
This should work fine - are you getting any errors?

Regards.
alwayslearningunix
# 3  
Old 08-23-2001
Hello !

trie :

cd /old_dir
find . -depth -print | cpio -pdlmv /new_dir

Good look !

Witt
witt
# 4  
Old 08-24-2001
Thank you all.
# 5  
Old 08-25-2001
tar

Another one with tar:

tar cvf - . | (cd new_dir; tar xvf -)
# 6  
Old 08-28-2001
Question

Why suggest of using "tar" command?
Seems like no good for this case.....

the "find" is the best in this case (i think)
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Script to copy certain info from several directories

Hi, I am writing a script to copy certain file name in txt file . It is working fine if I provide a single directory name (for example "/eos/uscms/store/user/pooja04//analysis2012/525/data/doubleele/2012/datav1/" ) where those specific files are present ending with *root . But I want to modify... (14 Replies)
Discussion started by: nrjrasaxena
14 Replies

2. Solaris

Folders with more than one 'owner'

I have a peculiar problem. I have a particular directory with the following characteristics: -bash-3.00# ls -lah total 18 drwxr-x--- 7 gandalf shire 512 jul 3 07:20 . drwxr-x--- 11 gandalf shire 512 mai 10 2010 .. drwxr-xr-x 6 gandalf shire 3,0K jul 24 19:25 brasdeff drwxr-xr-x... (9 Replies)
Discussion started by: poyato
9 Replies

3. Solaris

Privileges : modify dir/file owner by other that's not owner

i need to do the following operations in solaris 10: 1.change owner and group owner for files which are not owned by the current user and user group 2.to can delete files in the /tmp directory which are not of the current user 3. allow to a standard user the deletion of files in the /tmp... (1 Reply)
Discussion started by: sirmark
1 Replies

4. Shell Programming and Scripting

How to extract the day of the year and use that info to copy a file remotely

Hello, Thank you in advance for helping a newbie who is having great trouble with this simple task. I'm allowed to copy one file remotely each night due to bandwidth restrictions. A new file gets generated once a day, and I need to copy the previous day's file. Here is what I'd like to do:... (1 Reply)
Discussion started by: tmozdzen
1 Replies

5. Shell Programming and Scripting

How to find DL Owner info using ldapsearch?

Currently i have following syntax: ldapsearch -D "CN=..,OU=..,OU=All Businesses,DC=..,DC=..,DC=.." -w .. -h .. -p .. -b "OU=All Businesses,DC=..,DC=..,DC=.." "managedObjects=$DL_NAME_CN" employeeNumber givenName sn -S employeeNumber -x which gives me following info: "requesting:... (0 Replies)
Discussion started by: arsenghani
0 Replies

6. Shell Programming and Scripting

Need help to copy the lease info block

Hi, am having a lease file which contains lots os lease info. In that i have to copy the whole block(shown below) by identifying the mac and change the IP according to the i/p. I have used like sed s/${ip_addr}/$ch_ip/g $temp_file | grep -B5 "${mac}" >> $persistent_file sed... (2 Replies)
Discussion started by: SMNK
2 Replies

7. UNIX for Advanced & Expert Users

How UNIX admin set up this? how files of 744 of other owner can be removed by another owner?

Hi all, We have some files are under 744 permissions and the the owner is say owner1 and group1. Now we have another user owner2 of group2, owner2 can remove files of the owner1 and the permission of those files are 744, unix admin told us he did some config at his side so we can do that. ... (14 Replies)
Discussion started by: TheGunMan
14 Replies

8. UNIX for Dummies Questions & Answers

How to copy owner permissions to group

Hi, I need a command or a script to change the group permissions to be the same as the owner permissions for all my files and directories (recursive) any idea ? (4 Replies)
Discussion started by: ynixon
4 Replies

9. Solaris

Owner of file gets 'not owner' error for chgrp

Hi Folks, I know that changing users and groups is pretty basic admin, but this one has got me stumped. When I try to change the group of a file for which I am the owner for, it still gives me a 'Not owner' error. For example, when I am logged in as 'webadmin', I have the following file: ... (4 Replies)
Discussion started by: brizrobbo
4 Replies

10. Shell Programming and Scripting

change owner

Dear All, i have a file and i want to change the owner of that file from another user. for example $ ls -l pkc.txt -rw-r--r-- 1 tdmscrdr dba 717 Nov 2 17:10 pkc.txt the owner of pkc.txt file is tdmscrdr and group is dba i want to change the owner of this file from... (7 Replies)
Discussion started by: panknil
7 Replies
Login or Register to Ask a Question