LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
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 09-14-2005, 02:20 AM   #1
taiwf
Member
 
Registered: Jun 2005
Distribution: debian, ubuntu, redhat,knoppix
Posts: 194

Rep: Reputation: 31
cp: will not create hard link ?????


I try to backup some files from directory called 'mytext' with the following command :

#pwd
#/root/xarg
#find . -mtime -1 |xargs cp -r --target-directory=/mytext --parents

and i got error message:
cp: will not create hard link `/mytext/tarz' to directory `/mytext/./tarz'
cp: will not create hard link `/mytext/love' to directory `/mytext/./tarz/love'


But if i go into /mytext and do:
#cp ~/xarg/* /mytext

i dont' get any error message. Did i write my find command wrongly? I tried use cp -a , but the result stil the same(both command did copy files i 'touch')

can anyone explain to me why cp will create error message regarding hardlink while there is no link file existed ?



thx in advance

dav

Last edited by taiwf; 09-15-2005 at 07:12 PM.
 
Old 09-14-2005, 03:38 AM   #2
pats
Member
 
Registered: Jul 2005
Distribution: Debian Sarge/Etch, (K)Ubuntu, FC6, AIX5.3, VMWare ESXServer
Posts: 159

Rep: Reputation: 30
try cp -rf...
 
Old 09-15-2005, 07:12 PM   #3
taiwf
Member
 
Registered: Jun 2005
Distribution: debian, ubuntu, redhat,knoppix
Posts: 194

Original Poster
Rep: Reputation: 31
same result i use -rf option. Somehow this command keep thinking i am copying everything from /mytext directory (and content below) onto itself. Did i use xargs wrongly? I try to use -exec ...{} but if there are too many file i got error.

can anyone please help me or point me to the source i can look up?
 
Old 09-20-2005, 07:56 PM   #4
taiwf
Member
 
Registered: Jun 2005
Distribution: debian, ubuntu, redhat,knoppix
Posts: 194

Original Poster
Rep: Reputation: 31
i think its the -r flag cause error. Afterall the find . -mtime -1 produce individual files no directory (unlike cp * ). After i remove -r , it seems copy probably without complain..

But i still not so sure about the nature of error messsage.
 
  


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
Create Link? How??? ~zoey~ Linux - Newbie 9 07-24-2006 05:23 PM
how to create a link of a program ? anindyanuri Linux - Software 7 06-19-2005 02:11 PM
Soft Link and Hard Link Moataz Red Hat 1 04-25-2005 07:30 AM
How to create a link? sharathkv Linux - Newbie 4 07-29-2003 09:33 AM
How To: Create New Hard Disc Link on Desktop! FreakboY Linux - Software 0 09-16-2002 01:30 AM


All times are GMT -5. The time now is 10:51 PM.

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