LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   comparing directories and files (https://www.linuxquestions.org/questions/linux-newbie-8/comparing-directories-and-files-613998/)

crazy8 01-16-2008 09:48 AM

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

farslayer 01-16-2008 10:17 AM

Why not just use rsync to synchronize the two directories ?

http://www.cyberciti.biz/tips/linux-...rectories.html

wildcat22 01-16-2008 10:18 AM

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

wildcat22 01-16-2008 10:19 AM

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.

crazy8 01-16-2008 10:33 AM

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


All times are GMT -5. The time now is 12:30 AM.