LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   CPIO and Find Operation not permitted errors (https://www.linuxquestions.org/questions/linux-server-73/cpio-and-find-operation-not-permitted-errors-886360/)

metallica1973 06-14-2011 05:02 PM

CPIO and Find Operation not permitted errors
 
Below is the oneliner that I am using to exclude all of "." hidden directories within the same directory.

Code:

cd ~
find . -depth \( -wholename \./\.\* \) -prune -o -print | cpio -oav > /media/caca/extract/full$date.cpio

it works fine but when I extract the files from the full$date.cpio archive it appears to have worked but gives me permission errors:

Code:

cd /media/caca/extract
cpio -ivd < full061411.cpio
cpio: Selection_001.png: Cannot change mode to rw-r--r--: Operation not permitted
Selection_001.png
cpio: Selection_002.png: Cannot change mode to rw-r--r--: Operation not permitted
Selection_002.png
cpio: Selection_003.png: Cannot change mode to rw-r--r--: Operation not permitted
Selection_003.png
cpio: npatgpc.dl_: Cannot change mode to rw-r--r--: Operation not permitted
npatgpc.dl_
cpio: bash_history: Cannot change mode to rw-r--r--: Operation not permitted
bash_history
cpio: history_backup: Cannot change mode to rw-r--r--: Operation not permitted
history_backup
.
cpio: Ubuntu One: Cannot change mode to rwxrwxrwx: Operation not permitted
cpio: Pictures: Cannot change mode to rwxrwxrwx: Operation not permitted
cpio: Documents/scripts: Cannot change mode to rwxrwxrwx: Operation not permitted
cpio: Documents: Cannot change mode to rwxrwxrwx: Operation not permitted
cpio: Downloads/aflack/Oracle Lockout Issue Files: Cannot change mode to rwxrwxrwx: Operation not permitted
cpio: Downloads/aflack: Cannot change mode to rwxrwxrwx: Operation not permitted
cpio: Downloads/giobbi: Cannot change mode to rwxrwxrwx: Operation not permitted
cpio: Downloads/fitzpatrick: Cannot change mode to rwxrwxrwx: Operation not permitted
cpio: Downloads: Cannot change mode to rwxrwxrwx: Operation not permitted
cpio: Desktop: Cannot change mode to rwxrwxrwx: Operation not permitted
325167 blocks

It there a way to preserve the permission so that it does error like this?

unSpawn 06-14-2011 06:04 PM

What mount options is /media/caca mounted with, what file system is it on and are you copying out and in as the same user?

metallica1973 06-15-2011 09:48 AM

Thanks for the response:

What mount options is /media/caca mounted with?

Code:

//testbox/users/precious on /media/caca type cifs (rw,mand)
and here is my entry in fstab:

Code:

//testbox/users/precious /media/caca cifs credentials=/home/daman/.smbcredentials,iocharset=utf8,file_mode=0777,dir_mode=0777 0 0
with, what file system is it on?

Windows 2008 R2 using NTFS

Are you copying out and in as the same user?

YES, In my .smbcredential file I have to use my account name and password to access the share. This share is my home directory. This is an Ubuntu 10.04 box that I am mounting from to a Windows 2008 R2 domain controller

Also one more question:

What is the correct commandline substituion to add this as a variable using the Korn Shell?

Code:

full_backup_dir=$(find . -depth \( -wholename \./\.\* \) -prune -o -print | cpio -oav > /media/caca/extract/full$date.cpio)
and

Code:

$(find $home_dirs -mtime -1 | cpio -oa 2>/dev/null | ( cd $backup_dir && cpio -imd)
neither seem to work. ?

unSpawn 06-15-2011 02:24 PM

The only thing I can think of is something like CIFS UNIX extensions. I haven't got a box to test it with let alone W2K8 R2 tho, maybe somebody else has?..

metallica1973 06-16-2011 03:58 PM

The good news is that I am only testing it using my home directory for testing but when I perfect my script I will be running it from linux and backing up to a mounted ext3 external backup NAS. I am still curious what it maybe. Thanks for the response


All times are GMT -5. The time now is 04:02 PM.