Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
I have twin web servers (FC1) that are pseudo loadbalanced via DNS round robin. I need a way to replicate new content to both servers instantly. So far I have come up with this.
Run at startup:
dnotify -MCDRB /webroot -e /rsync-script &
The /rsync-script will simply propogate changed files from the first webserver over to the second fairly instantaneously, using rsync.
The only thing im uneasy about is having the /rsync-script invoked every time a file is transferred via FTP to the first server. During the transfer of some smaller files, this couldmean the script is run hundreds of times a second. Even If it does run reliably at that speed, I think I may run into problems because dnotify will invoke rsync at the end of every file transfer, yet rsync will attempt to transfer all files that have changed. It is my understanding that dnotify can not specify which individual files have changed in a directory - only that files ave indeed changed, so we cant just transfer them one at a time.
Does anyone else have a more elegant solution to this problem?
I was thinking you could use dnotify to write a timestamp into a file (date +%s > timestampfile) or just use the touch command to update its timestamp. Then, you'd know the last time a file in the directory was changed.
The next step is to have a cron job running that checks the file every so often, and if sufficient time has passed since the timestamp file was updated, run rsync.
One drawback is rsync will run unnecessarily quite a few times.