You are not logged in.

#1 2011-01-09 19:00:15

Osiris
Member
Registered: 2003-01-18
Posts: 157
Website

Copy without permissions

Hello,

I want to accomplish an apparently trivial task: copy a file without copying the permissions.

I tried cp, cp --no-preserve=all and rsync. All commands preserved the permissions set with chmod.

How can I copy without the permissions (and use the default permissions as if the file was just created)?

Thanks!

Offline

#2 2011-01-09 19:27:34

defears
Member
Registered: 2010-07-26
Posts: 218

Re: Copy without permissions

What filesystem? And who owns whatever folder or drive you are copying to?

Offline

#3 2011-01-09 20:11:10

Osiris
Member
Registered: 2003-01-18
Posts: 157
Website

Re: Copy without permissions

Source and destination are both ext4. Destination is my home dir, e.g. owned by my user. Source is an external drive, files are also owned by myself. Since the drive has been mounted by KDE / HAL / whatever, I think the ownership has been set by the mount command.

Offline

#4 2011-01-09 20:41:58

dyscoria
Member
Registered: 2008-01-10
Posts: 1,007

Re: Copy without permissions

What do you mean by "use the default permissions as if the file was just created"??

Presumably you've changed the permissions of certain files. Once they are changed, they don't remember what the original permissions were. You'll have to manually set the permissions to what you want them to be.


flack 2.0.6: menu-driven BASH script to easily tag FLAC files (AUR)
knock-once 1.2: BASH script to easily create/send one-time sequences for knockd (forum/AUR)

Offline

#5 2011-01-09 21:05:43

defears
Member
Registered: 2010-07-26
Posts: 218

Re: Copy without permissions

I know this doesn't help, but I always leave a 4 gig partition at the end of all my external drives with FAT so I can easily copy files to it when I want to share with other people. I just don't want to screw up my permissions and chown'ing with root if I don't need to.

Offline

Board footer

Powered by FluxBB