[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

linux copy giving error message cp: cannot create special file...

Posted on 2011-02-22
3
Medium Priority
?
2,273 Views
Last Modified: 2012-05-11
Trying to move a folder to a mounted drive.  Folder is on ubuntu 8 and destination is mounted share on Windows server 2003.

find /opt/backup/backup-zimbra/ iname '2011*' -mtime -1 -exec cp -r {} /mnt/zimbraBackup/ \;

find command works and so does cp if I leave off the -r.  But I need to keep the file tree structure in tact. When i use cp -r I get this error message for some but not all files being copied.

cp:cannot create special file ' mnt/zimbraBackup/backup-zimbra/2011-02-16-00-30-01/cyrus-sasl-2.1.23.3z/state/mux': Operation not permitted

Any help on how I  can copy this and retain the directory tree would be greatly appreciated.
0
Comment
Question by:chenault68
3 Comments
 
LVL 12

Expert Comment

by:mccracky
ID: 34956250
It could be that you are trying to copy a file into a place in the tree that doesn't yet have that directory created.  

the -r option usually applies to the source, not the destination.

wget or rsync might be better to keep the directory structure intact.
0
 
LVL 10

Accepted Solution

by:
abbright earned 2000 total points
ID: 34958507
The error message sounds as if the cp-command tries to copy a "special" file which does not work. Special files in Linux are for example fifo queues or block devices which are not real files but rather communication devices or so represented in the filesystem.
I guess it is not possible to copy these as you try to copy them to a Windows server share and the windows NTFS-filesystem does not support those special files.
0
 

Author Closing Comment

by:chenault68
ID: 34966667
Had to change tactics.  Went with tar instead of cp

thanks
0

Featured Post

 The Evil-ution of Network Security Threats

What are the hacks that forever changed the security industry? To answer that question, we created an exciting new eBook that takes you on a trip through hacking history. It explores the top hacks from the 80s to 2010s, why they mattered, and how the security industry responded.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Creating a Samba server for a small office. Ubuntu Linux and Samba can breathe new life into a retired PC and save an office money on new hardware/software. Our example server will have two hard disks, one exclusively for storing shared data. …
This article will show you step-by-step instructions to build your own NTP CentOS server.  The network diagram shows the best practice to setup the NTP server farm for redundancy.  This article also serves as your NTP server documentation.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question