LinuxQuestions.org
Help answer threads with 0 replies.
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-04-2005, 04:47 AM   #1
paddyjoy
Member
 
Registered: Apr 2005
Location: Sydney
Distribution: FC5
Posts: 174

Rep: Reputation: 30
Copying files


Anyone have any idea of an easy way to do this.

A few months ago I copied about 20 GB's of files into a shared directory on another pc. I want to do the same again but I don't want to waste time copying existing files, just want to get the new/changed ones. I can do the copy easily with the cp command but I need some way of automatically saying no when it asks if I want to overwrite. Can't find any option in the man pages.

Any ideas?

Paddy
 
Old 07-04-2005, 05:06 AM   #2
hfawzy
Member
 
Registered: Aug 2002
Location: Egypt
Distribution: Debian Sarge, Slackware 10.0
Posts: 163

Rep: Reputation: 30
The cp command doesn't ask you you to overwrite unless you passed the -i option (interactive). So I guess that you have an alias that includes this option automatically.
So you can either remove this alias, or you can just type /bin/cp instead of cp.
 
Old 07-04-2005, 05:18 AM   #3
paddyjoy
Member
 
Registered: Apr 2005
Location: Sydney
Distribution: FC5
Posts: 174

Original Poster
Rep: Reputation: 30
Thats interesting never noticed that! So what does it do by default if the file already exists?

Paddy
 
Old 07-04-2005, 05:23 AM   #4
hfawzy
Member
 
Registered: Aug 2002
Location: Egypt
Distribution: Debian Sarge, Slackware 10.0
Posts: 163

Rep: Reputation: 30
It overwrites the file by default.
By the way, you can view all your 'aliases' by typing alias in a command prompt. You should notice this line : alias cp = 'cp -i'.
Edit : Just forgot to say, if you want to remove an alias, type in a command prompt : "unalias cp"

Last edited by hfawzy; 07-04-2005 at 05:27 AM.
 
Old 07-04-2005, 05:27 AM   #5
paddyjoy
Member
 
Registered: Apr 2005
Location: Sydney
Distribution: FC5
Posts: 174

Original Poster
Rep: Reputation: 30
Thanks for the info. I think I'll try and use dump to do a proper backup, might be better in the long run.

Paddy
 
Old 10-24-2013, 02:37 PM   #6
abhijeetdutta
Member
 
Registered: Aug 2009
Posts: 141

Rep: Reputation: 16
easy and steady

rsync is a program that behaves in much the same way that rcp does, but has many more options and uses the rsync remote-update protocol to greatly speed up file transfers when the destination file already exists.

The rsync remote-update protocol allows rsync to transfer just the differences between two sets of files across the network link, using an efficient checksum-search algorithm described in the technical report that accompanies this package.
 
Old 10-25-2013, 02:13 AM   #7
JJJCR
Senior Member
 
Registered: Apr 2010
Posts: 2,290

Rep: Reputation: 467Reputation: 467Reputation: 467Reputation: 467Reputation: 467
use rsync to do incremental backup:

rsync -av --log-file=/var/log/myrsync.log /media/source_dir /media/destionation_dir
 
Old 10-25-2013, 02:27 AM   #8
Firerat
Senior Member
 
Registered: Oct 2008
Distribution: Debian sid
Posts: 2,683

Rep: Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783
Quote:
Originally Posted by alstonnat View Post
How is it going with you Paddy?
I tried and it works for me.
Thank you buddy!
Paddy is unlikely to answer

Last Activity: 2007-01-14 21:46


This thread was started:- 2005-07-04
and until yesterday the last post was 2005-07-04

But yes, rsync is the perfect utility for such things
 
Old 10-25-2013, 02:39 AM   #9
JJJCR
Senior Member
 
Registered: Apr 2010
Posts: 2,290

Rep: Reputation: 467Reputation: 467Reputation: 467Reputation: 467Reputation: 467
wow..hmm..good catch Firerat

Hope this will help someone along the way
 
Old 10-25-2013, 06:47 AM   #10
paddyjoy
Member
 
Registered: Apr 2005
Location: Sydney
Distribution: FC5
Posts: 174

Original Poster
Rep: Reputation: 30
He he blast from the past ;-)

rsync is the way to go, or if you want something more interactive unison-gtk is good, it's based on rsync.
 
Old 10-25-2013, 11:12 AM   #11
Firerat
Senior Member
 
Registered: Oct 2008
Distribution: Debian sid
Posts: 2,683

Rep: Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783
Now... I didn't expect that
 
  


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
copying files(s) in c climbingmerlin Programming 7 10-27-2005 02:00 PM
need help with copying files Earl Parker II Linux - General 8 09-12-2005 08:54 AM
copying files neozero62 Linux - Newbie 1 11-23-2003 05:38 PM
copying files Sol0 Linux - Software 7 08-18-2003 10:40 AM
Copying Files... viperquest Linux - Software 3 03-07-2003 02:41 PM

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

All times are GMT -5. The time now is 11:09 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
Open Source Consulting | Domain Registration