LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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, 05: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, 06: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, 06: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, 06: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 06:27 AM.
 
Old 07-04-2005, 06: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, 03:37 PM   #6
abhijeetdutta
Member
 
Registered: Aug 2009
Posts: 135

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, 03:13 AM   #7
JJJCR
Member
 
Registered: Apr 2010
Posts: 550

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

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

Rep: Reputation: 444Reputation: 444Reputation: 444Reputation: 444Reputation: 444
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, 03:39 AM   #9
JJJCR
Member
 
Registered: Apr 2010
Posts: 550

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

Hope this will help someone along the way
 
Old 10-25-2013, 07: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, 12:12 PM   #11
Firerat
Senior Member
 
Registered: Oct 2008
Distribution: Debian Jessie / sid
Posts: 1,471

Rep: Reputation: 444Reputation: 444Reputation: 444Reputation: 444Reputation: 444
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 03:00 PM
need help with copying files Earl Parker II Linux - General 8 09-12-2005 09:54 AM
copying files neozero62 Linux - Newbie 1 11-23-2003 06:38 PM
copying files Sol0 Linux - Software 7 08-18-2003 11:40 AM
Copying Files... viperquest Linux - Software 3 03-07-2003 03:41 PM


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

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration