LinuxQuestions.org
Register a domain and help support LQ
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 01-16-2008, 09:48 AM   #1
crazy8
Member
 
Registered: Nov 2006
Posts: 132

Rep: Reputation: 15
comparing directories and files


This should be an easy question for most of you to answer. I am ftping files from one server to another and when I SSH to both systems and do a "tree" on alot of the directories i seem to be having a difference of a few files, sometimes more. Is there an easy (or easier) way to actually SEE what files are on the original server and arnt on the new one. without having to dig through thousands of directories andlooking over each individual file?

Thanks for the help
 
Old 01-16-2008, 10:17 AM   #2
farslayer
Guru
 
Registered: Oct 2005
Location: Willoughby, Ohio
Distribution: linuxdebian
Posts: 7,228
Blog Entries: 5

Rep: Reputation: 189Reputation: 189
Why not just use rsync to synchronize the two directories ?

http://www.cyberciti.biz/tips/linux-...rectories.html
 
Old 01-16-2008, 10:18 AM   #3
wildcat22
Member
 
Registered: Nov 2003
Location: USA
Distribution: Ubuntu
Posts: 102

Rep: Reputation: 15
I'm not familiar with "tree", but generating a listing of files and running them through diff comes to mind.

Run:
Code:
 $ find . | sort > listing1
On both machines (change the name of the listing for the second).

Then run diff (or sdiff) against the two listings:

Code:
 $ diff listing1 listing2
 
Old 01-16-2008, 10:19 AM   #4
wildcat22
Member
 
Registered: Nov 2003
Location: USA
Distribution: Ubuntu
Posts: 102

Rep: Reputation: 15
I think the rsync way is a good one, if you will be doing this constantly. I read it as though this was a one time thing.
 
Old 01-16-2008, 10:33 AM   #5
crazy8
Member
 
Registered: Nov 2006
Posts: 132

Original Poster
Rep: Reputation: 15
Well yes in a sense this is a one time thing but it will take me all month to do it manually if I have to compare ll the directories on my systems. Now with the rsync thing I am assuming i want to do this method
Task: Mirror a directory between my “old” and “new” web server/ftp?

Also in regards to the rsync, I should install rsync onto the "new" server correct?

thanks again
 
  


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
Perl: comparing 2 files UnixKiwi Programming 14 07-05-2007 03:27 AM
Comparing directories ursusman Linux - Newbie 5 07-04-2006 06:56 AM
comparing lots of files Frustin Linux - General 4 09-22-2005 02:54 PM
Comparing 2 Files xianzai Programming 2 05-23-2004 11:50 AM
check for matching files when comparing directories WarriorWarren Linux - General 3 05-07-2003 01:40 PM


All times are GMT -5. The time now is 09:10 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