LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-15-2006, 10:55 AM   #1
Calgarian
Member
 
Registered: Feb 2005
Location: Calgary, AB Canada
Distribution: Kubuntu 6.10
Posts: 44

Rep: Reputation: 15
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
 
Old 07-15-2006, 12:41 PM   #2
xpromisex
Member
 
Registered: Apr 2004
Location: Statesboro, GA
Distribution: Arch Linux 2007.05 "Duke" (Kernel 2.6.21)
Posts: 447

Rep: Reputation: 30
would a simple:

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

work?

I know that seems simple, but that's how I have done it before.
 
Old 07-16-2006, 03:56 AM   #3
Calgarian
Member
 
Registered: Feb 2005
Location: Calgary, AB Canada
Distribution: Kubuntu 6.10
Posts: 44

Original Poster
Rep: Reputation: 15
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.
 
Old 07-16-2006, 04:06 AM   #4
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
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
 
Old 07-16-2006, 04:31 AM   #5
spooon
Senior Member
 
Registered: Aug 2005
Posts: 1,755

Rep: Reputation: 50
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
 
Old 07-16-2006, 05:34 AM   #6
Calgarian
Member
 
Registered: Feb 2005
Location: Calgary, AB Canada
Distribution: Kubuntu 6.10
Posts: 44

Original Poster
Rep: Reputation: 15
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.
 
Old 07-16-2006, 10:07 AM   #7
xpromisex
Member
 
Registered: Apr 2004
Location: Statesboro, GA
Distribution: Arch Linux 2007.05 "Duke" (Kernel 2.6.21)
Posts: 447

Rep: Reputation: 30
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...
 
Old 07-16-2006, 10:23 AM   #8
Calgarian
Member
 
Registered: Feb 2005
Location: Calgary, AB Canada
Distribution: Kubuntu 6.10
Posts: 44

Original Poster
Rep: Reputation: 15
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
L.A.M.P and selection binary_dreamer Programming 5 06-21-2006 03:05 AM
GTK File Selection Question EnigmaX Programming 3 02-14-2006 01:02 AM
GTK Getting Filename From A File Selection Button HELP animehair Linux - Software 1 02-13-2006 11:58 PM
I miss my lovely GTK+ file selection melinda_sayang Slackware 0 07-12-2004 11:55 PM
How to get Source code of Gtk File Selection Widget chaits Linux - General 0 04-14-2004 10:43 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration