how to can I rsync files frequently upon regular intervals from one server to another
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
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.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
how to can I rsync files frequently upon regular intervals from one server to another
how to can I rsync files frequently upon regular intervals from one server to another?? Whenever file A is updated on server1 the file should reflect its changes on server2 immediately. Is there a way or I should go only with "rsync -t file_a 192.168.21.7:/tmp/ " and put in cron to update every minute?
Last edited by mannoj87; 05-31-2012 at 07:00 AM.
Reason: to specifiy clearly
that question screams for the answer "cron". Try putting "cron tutorial" or "cron howto" into your favourite search engine.
Assuming you are using rsync over ssh, you'll probably also want to setup private/public key based authentication (without a passphrase). There are plenty of howtos on this topic too.
I think there is no way to automatically sync server2 any time when something has changed on server1 immediately, but surely you can white a small script to sync and configure cron to start it in every minute/second/hour...
Indeed, if the OP had asked to run the rsync when files were updated I would have suggested incron, but since the query was about regular time intervals cron seemed to be the obvious answer.
incron seems to be a better one for now. Though it uses rsync again, but this helps me to update the destination host whenever the file is written on source. This works with the help of <file_change_mask> option - in incron IN_CLOSE_WRITE, IN_MODIFY . Looks cool !! Thanks for your suggestion Evo
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.