The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Server Synchronization kumarrana UNIX for Dummies Questions & Answers 3 05-09-2008 03:28 AM
Date Synchronization tovohery AIX 5 04-19-2007 11:39 AM
Synchronization of 2 directories Hitori UNIX for Advanced & Expert Users 5 02-23-2007 10:37 AM
Time synchronization skotapal UNIX for Dummies Questions & Answers 1 10-29-2003 04:44 PM
Date synchronization skotapal UNIX for Dummies Questions & Answers 2 11-25-2002 01:36 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 05-15-2008
splakang25 splakang25 is offline
Registered User
  
 

Join Date: May 2008
Posts: 2
directory synchronization

Can anybody help me on how to do directory synchronization. i have been reading about rsync and filesync but apparently it seems to me that synchronization is from a source directory to a destination directory only. how about if vice versa - wherein i need to synchronize both directories, updating based on the most recent data, whichever directory has it. is this possible with rsync or filesync? can you provide an alternative for this.
thanks.
  #2 (permalink)  
Old 05-16-2008
jim mcnamara jim mcnamara is offline Forum Staff  
...@...
  
 

Join Date: Feb 2004
Location: NM
Posts: 5,643
IF you need two directories to match, in terms of actual file content as well as filenames,
then copy all the diifferent files from dir2 to dir1. Remove dir2 completely. Create dir2 as a link to dir1. Then you do not have to worry about synchronization. This assumes the directories are mounted on the same unix box. Otherwise, NFS mount dir1 on the remote box as dir2. In this case dir2 should not be at root level, ie. literally not : /dir2
  #3 (permalink)  
Old 05-18-2008
splakang25 splakang25 is offline
Registered User
  
 

Join Date: May 2008
Posts: 2
Jim,

Thanks for the reply. I agree that placing dir2 to dir1 and linking dir2 to dir1 synchronizes them, but how will i be able to determine that the files in dir2 are the most recent files and not those in dir1? How can I determine which files in which directory is more recent without manually checking them 1 by 1. And what if their directory structures are different?
  #4 (permalink)  
Old 05-18-2008
pupp's Avatar
pupp pupp is offline Forum Staff  
cap_10hdx 1
  
 

Join Date: Feb 2008
Location: Jersey Shore
Posts: 542
ls -t will give you the last mod time of any file. just write a script that will compare each file in dir1 and dir2 and sync on the latest mod of the files. i don't understand why the file structure would be different if you are trying to sync the same stuff across two fs or platforms... do you mean the full paths are different? shouldn't matter.
Sponsored Links
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 10:29 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language translation by Google.
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0