LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   cp and file selection (https://www.linuxquestions.org/questions/linux-newbie-8/cp-and-file-selection-464300/)

Calgarian 07-15-2006 09:55 AM

cp and file selection
 
I am trying to copy only the dot files and folders from my home to an other directory. I need to regress the directories to get all the content. I can't seem to create a cp command that will copy only the dot files and directories. The one I've narrowed down to still copies every directory and file from the source. Any suggestions? The directory /BackUp/Home exists and has the correct privileges. Here's my current command:

cp -pR /home/myid/.* /BackUp/Home/

TIA

xpromisex 07-15-2006 11:41 AM

would a simple:

cp -r /home/myid/.* /BackUp/Home

work?

I know that seems simple, but that's how I have done it before.

Calgarian 07-16-2006 02:56 AM

cp and file selection
 
Gave your idea a try and still didn't get what I wanted. All the dot files/directories were copied and also all the non-dot ones as well. That's what I wanted to try and stop.

I am using Kubuntu 6.10 and trying to do backups to DVD+RW. I have tried KDar and K3B to back up this stuff and it doesn't work for me. KDar's big files (even when restricted to 4Gb) won't write correctly to DVD+RW using K3B. And if I try tar, when I try to load a DVD with a single large tar file it won't mount unless I go into a konsole and force it to mount. It shows up as blank media and gives me a malformed URL error.

I am trying to build a Bash script to selectively copy to directories that I can burn to DVD+RW with K3B as a series of uncompressed directories/files. For this step all I want is the dot directories and files from my home. I could copy everything and delete the stuff I don't want, but that is not a correct solution. I guess I'll just keep poking around for now and see if I can get an automated solution.

Tinkster 07-16-2006 03:06 AM

http://silvercoders.com/index.php?page=DVD_Backup
http://scdbackup.webframe.org/main_eng.html
http://danborn.net/multicd/
to list just a few versatile tools that do multi-volume backups
to CDs ... I think the last one is closest to what you want.



Cheers,
Tink

spooon 07-16-2006 03:31 AM

Quote:

Originally Posted by Calgarian
I am trying to copy only the dot files and folders from my home to an other directory. I need to regress the directories to get all the content. I can't seem to create a cp command that will copy only the dot files and directories. The one I've narrowed down to still copies every directory and file from the source. Any suggestions? The directory /BackUp/Home exists and has the correct privileges. Here's my current command:

cp -pR /home/myid/.* /BackUp/Home/

TIA

the reason it doesn't work is that the shell expands .* to also include . (the current directory) and .. (the parent directory) and cp -r causes it to recursively copy those directories too

Calgarian 07-16-2006 04:34 AM

cp and file selection
 
Tinkster: I had used multicd several years ago and forgotten about it completely. Thanks for the very timely reminder. I'm off and running now.

xpromisex 07-16-2006 09:07 AM

Forgot about the .. being a recursive name for the "up" function...Now that I think about it - I don't remember how I did that...

Calgarian 07-16-2006 09:23 AM

cp and file selection
 
I must be having a big time K3B issue. I used multicd and created 6 images. Each is right around 4Gb so I'm back in the soup again. K3B will not write them at all. Fortunately I'm using RW media so I'm not making coasters yet. This is becoming a real pain, but it might all be down to a K3B issue. I do have udf support set on. K3B appears to write a random amount of data to the device and then does a very long lead out write and finishes with an indication that it is properly done. I'll go talk to the K3B area and see if I find any advice there. Thanks guys.


All times are GMT -5. The time now is 05:02 AM.