#1  
Old 3rd July 2008, 07:12
templas templas is offline
Junior Member
 
Join Date: Feb 2008
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default help with bash

i need to write a script that compares two directories AAAA & BBBB. The differences in directory AAAA should be copied to BBBB. Just like incremental copy. One more thing that were are about 200000 files in both directories to compare. The server is powerful enough. Can someone help to write a script? All the action is done in one server. The files are copied between serveral storages.

First i make file list of both directories with find, sed and cut and sort. Then compare two text files with diff or comm... the differences go to new text file. And then just copy the files from the list with cp. Maybe someone has good thoughts about how to speed up and put everything into one script?

Thanks
Reply With Quote
Sponsored Links
  #2  
Old 3rd July 2008, 17:57
topdog topdog is offline
Senior Member
 
Join Date: Jan 2008
Location: South Africa
Posts: 1,352
Thanks: 0
Thanked 152 Times in 149 Posts
Default

why waste your time scripting that when you can just use rsync ?
__________________
----
http://www.topdog.za.net - Got Linux problems ? - I can help.
http://www.baruwa.org - Try it.
Reply With Quote
  #3  
Old 4th July 2008, 06:55
templas templas is offline
Junior Member
 
Join Date: Feb 2008
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

i don't need files to be moved between serverts, i nedd them to be moved between storages(different partitions)
Reply With Quote
  #4  
Old 4th July 2008, 12:08
topdog topdog is offline
Senior Member
 
Join Date: Jan 2008
Location: South Africa
Posts: 1,352
Thanks: 0
Thanked 152 Times in 149 Posts
Default

rsync can still do that.
__________________
----
http://www.topdog.za.net - Got Linux problems ? - I can help.
http://www.baruwa.org - Try it.
Reply With Quote
  #5  
Old 4th July 2008, 13:43
templas templas is offline
Junior Member
 
Join Date: Feb 2008
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

but still were are 200K of files, how to speedup the process?
Reply With Quote
  #6  
Old 4th July 2008, 13:49
topdog topdog is offline
Senior Member
 
Join Date: Jan 2008
Location: South Africa
Posts: 1,352
Thanks: 0
Thanked 152 Times in 149 Posts
Default

actually if by 200k you mean 200 thousand, you will not be able to do that with a script as the number of arguments most commands can take is limited.

Still i don't see how a script that is being interpreted can be faster than a binary program
__________________
----
http://www.topdog.za.net - Got Linux problems ? - I can help.
http://www.baruwa.org - Try it.
Reply With Quote
  #7  
Old 4th July 2008, 17:19
sjau sjau is offline
Local Meanie
 
Join Date: Apr 2006
Location: Switzerland
Posts: 1,126
Thanks: 4
Thanked 43 Times in 40 Posts
Default

I'd also go for rsync
__________________
"Common sense is not as common as commonly believed" by sjau

Auto-Install Script for ISPConfig and Horde on a Vanilla Debian Stable

Need more Repos for Ubuntu? Repository Generator
Need more Repos for Debian? Debian Repository Generator
Reply With Quote
  #8  
Old 8th July 2008, 12:27
quentin quentin is offline
Junior Member
 
Join Date: Mar 2008
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
 
Thumbs up Rsync

Definately use rsync.
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
i am having some problem ? cobro Installation/Configuration 20 30th April 2008 16:26
Cannot log onto pop3 server Debian Etch Perfect Server docean Installation/Configuration 2 19th March 2008 00:23
https protocol stops page load tjd General 7 18th November 2007 18:06
Help Stats Webalizer jfruano Installation/Configuration 2 27th February 2007 13:03
ISPConfig install error: The PHP binary coming with ISPConfig does not work... mlanglois Installation/Configuration 9 13th July 2006 14:56


All times are GMT +2. The time now is 23:35.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.