I'm setting up two servers and I need to configure one of them to monitor two folders and sync everything of that folder to another server via sftp. I was thinking of using rsync to do this.
This is what I need.
Server one (main server that has all the uploaded files) - IP: 192.168.1.125
Folders that need to be synced:
These to folders need to be synced continuously to another server via sftp using rsync
Server Two (synced server) - IP: 192.168.1.126
Images will be saved to: /var/www/website/images/
Videos will be saved to: /var/www/website/videos/
How can I do this? is there a place online were I can find a tutorial on how to accomplish this? or maybe already a script that I could modify to my needs?