Whats the quickest easiest way to syncronize two directories?

Posted on 2004-10-08
Last Modified: 2010-04-21
It would be nice if the solution could handle open files, but not necessary. I want to sync files on a single server from directory A to directory B. I expect to run from cron every 3 hours or so, it is not a deep directory, but about 7 gig worth of data. Then I plan to backup to tape directory B.
Question by:dwanders
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
LVL 40

Accepted Solution

jlevie earned 150 total points
ID: 12262706
rsync across an NFS mount would probably be the fastest. Whether it will complete in less than 3 hours for 7Gb of data will depend on the load on the prime & backup servers, network availability, and the amount of change. Since reads are faster than writes I'd run the rsync from the backup server.

Author Comment

ID: 12262745
There are no NFS mounts involved, in fact networking is not a factor - this will be copying from /dir1  to   /dir2 on the same computer, same filesystem etc... I thought rsync was for remote sync? It would be nice if it could tell if a file had changed or not, should cut down on the ammount time needed to run.
LVL 40

Expert Comment

ID: 12262931
rsync doesn't care whether there's a remote involed or not. It just needs a master and slave specified.

I guess I don't see the point of sync'ing two directories on the same server and then backing up the slave. That doesn't help w/respect to open files and it would be more efficient to to simply run the backup against the master directory.
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


Author Comment

ID: 12262933
Just read the man page, and I believe you have won the cigar. THis looks like it should work fine for my needs loaclly and I dont even need to spend much time on it so I am going to bump your points 25.


Author Comment

ID: 12262954
We have users that work at different time, so I am hoping this is a cheap easy open file alternative. I will rsync every 6 hours or so to catch all three shifts, skipping the open when the are working and chacheing them the next shift. then a midnight, I will backup the copy folder. You think there may be a more effician way of doing it?
LVL 40

Expert Comment

ID: 12264284
If you could arrainge things such that the mutable data for each shift was collected into a "shift dir" you could very efficiently and safely do the backups and completely avoid any open files.

Author Comment

ID: 12275880
Whlie that might be possible, the logistics would be pretty annoying. Especially with folks moving around shifts all the time. I am sure that I could easily keep a list of certain users, their files, and which shift they work - then write a script to run the rsync based on my list of user when they were working etc ... but I believe I will let it run and see how well it works out with out all that mess. Then the users can move as they wish and I dont even need to knwo about it =).

Thanks again for your suggestion, I think it is work out very nicely - especially once the mirror is built it should run pretty quickly.

Featured Post

Veeam gives away 10 full conference passes

Veeam is a VMworld 2017 US & Europe Platinum Sponsor. Enter the raffle to get the full conference pass. Pass includes the admission to all general and breakout sessions, VMware Hands-On Labs, Solutions Exchange, exclusive giveaways and the great VMworld Customer Appreciation Part

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever been frustrated by having to click seven times in order to retrieve a small bit of information from the web, always the same seven clicks, scrolling down and down until you reach your target? When you know the benefits of the command l…
The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses

622 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question