Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Tue Jun 22, 2010 4:02 pm 
Offline
Senior Newbie

Joined: Thu Jan 14, 2010 3:25 am
Posts: 5
I'm trying to copy a directory over to another location (it's a automated process), and it's using cp -Rf directory /new/directory

however, it doesn't seem to force it, it still asks if I want to overwrite it, therefore the script isn't working properly since it isn't overwriting the files.

Is there a way I can fix this?

Thanks


Top
   
 Post subject:
PostPosted: Tue Jun 22, 2010 4:10 pm 
Offline
Junior Member

Joined: Thu Jun 03, 2010 4:44 pm
Posts: 35
Do you have an alias setup for the cp command that includes the interactive prompts (-i or --interactive)?
Code:
$ alias

If so, remove it:
Code:
$ unalias cp

Or run the command directory from the /bin folder:
Code:
$ /bin/cp -Rf directory /new/directory


Top
   
PostPosted: Tue Jun 22, 2010 10:14 pm 
Offline
Senior Member

Joined: Fri Dec 07, 2007 1:37 am
Posts: 385
Location: NC, USA
bat wrote:
cp -Rf directory /new/directory

Not sure if it is related to your problem, but that command will give different results depending on whether /new/directory does not exist, exists as a file, or exists as a directory. You might want to take a peek at the -t option for cp. Or even better take a look at using rsync, which IMO handles local directory copying much better than cp.


Top
   
 Post subject:
PostPosted: Thu Jun 24, 2010 4:02 am 
Offline
Senior Newbie

Joined: Thu Jan 14, 2010 3:25 am
Posts: 5
BrianJM wrote:
Do you have an alias setup for the cp command that includes the interactive prompts (-i or --interactive)?
Code:
$ alias

If so, remove it:
Code:
$ unalias cp

Or run the command directory from the /bin folder:
Code:
$ /bin/cp -Rf directory /new/directory


The unalias cp worked, Thanks!


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group