![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| 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 !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Server Synchronization | kumarrana | UNIX for Dummies Questions & Answers | 3 | 05-09-2008 12:28 AM |
| Date Synchronization | tovohery | AIX | 5 | 04-19-2007 08:39 AM |
| Synchronization of 2 directories | Hitori | UNIX for Advanced & Expert Users | 5 | 02-23-2007 07:37 AM |
| Time synchronization | skotapal | UNIX for Dummies Questions & Answers | 1 | 10-29-2003 01:44 PM |
| Date synchronization | skotapal | UNIX for Dummies Questions & Answers | 2 | 11-25-2002 10:36 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
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. |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
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
|
|||
|
|||
|
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
|
||||
|
||||
|
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.
|
||||
| Google The UNIX and Linux Forums |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|