LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 09-25-2003, 04:07 AM   #1
myunicom
LQ Newbie
 
Registered: Sep 2003
Posts: 14

Rep: Reputation: 0
Question How to delete the destination files while the source files deleted in cp -u ?


I use cp -u to back up DirA to DirB every day. DirA files are changed every day( created or deleted). I find that when DirA files creatd the cp command can back up the newly created files into DirB, but can not delete the DirB corresponding files while it was deleted in DirA. Any Ideas ?

thanks.
 
Old 09-25-2003, 07:27 AM   #2
Nezzo
Member
 
Registered: Sep 2003
Distribution: Slackware, Ubuntu
Posts: 65

Rep: Reputation: 15
try cp -r
 
Old 09-25-2003, 11:44 PM   #3
lyle_s
Member
 
Registered: Jul 2003
Distribution: Slackware
Posts: 388

Rep: Reputation: 52
I'm don't think cp will delete files like you want it to. rsync was made for the job you're doing, and it can.

Lyle
 
Old 09-26-2003, 11:16 AM   #4
myunicom
LQ Newbie
 
Registered: Sep 2003
Posts: 14

Original Poster
Rep: Reputation: 0
Thanks for lyle_s's help.

Can you tell me if the rsync command has max filesize limitation( like cpio max filesize 2G)?

thanks again.
 
Old 09-26-2003, 01:13 PM   #5
lyle_s
Member
 
Registered: Jul 2003
Distribution: Slackware
Posts: 388

Rep: Reputation: 52
You're welcome!

No, I don't see anything in man rsync about excluding files based on their size, just by name. So, if the files you don't want rsync'd have paths/names conforming to some pattern, you may be able to use that.

I'd imagine you could combine find and rsync to do what you want.

Lyle
 
  


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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Including header files and source files for classes Feenix Programming 8 09-28-2005 10:53 AM
Old YaST source files - can I delete Suse 9l1 harry_fine Linux - Distributions 0 09-10-2004 01:12 PM
How do I have tar skip files already on destination HD? Bob Ross Red Hat 2 02-04-2004 12:43 PM
Can I delete source files? downinthemine Linux - Software 1 01-09-2004 07:54 AM
How to use .spm files (Source Package Files) concoran Linux - General 1 06-10-2001 02:09 PM


All times are GMT -5. The time now is 03:52 PM.

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