Dany Lavrov Dany Lavrov - 7 days ago 4x
Linux Question

enable rsync to run permanently

I have two machines, both running on linux with centos 7.
I have installed the rsync packages on both of them and i am able to sync a directory from one machine to the other.

Right now i am doing the syncing manually, each time i want to sync i am running the next line:

rsync -r /home/stuff root@

I was wondering if there is a way of configuring the rsync to do the syncing automatically, every some amount of time or preferably when there is a new file of sub directory in the home directory?

Thank you for your help.
Any help would be appreciated.


If you want to rsync every some amount of time you can use cronjobs which can be configured to run a specific command each amount of time and if you want to run rsync when there is an update or modification you can use lsyncd. check this article about use lsyncd