-1

Monitor the file for changes. If the file is changed, run a script to copy that file to other servers using scp or rsync.

i am looking for automatic script to copy the changes in the file from local server to another server ..

bhushan
  • 11

2 Answers2

1

You can do it with lsyncd. It's using inotify so is reacting very fast even with big datasets.

https://github.com/axkibe/lsyncd

https://www.lucasrolff.com/ha/replication-using-lsyncd/

Lazy404
  • 181
  • 1
  • 5
0

rsync will only synchronize files that have been changed. You can set up an rsync command that will synchronize every hour or at a specified time interval and it will only sync the files that have been changed.

Jeff Schaller
  • 66,199
  • 35
  • 114
  • 250
Heilla
  • 43
  • 1
  • 7
  • do you have any script to rsync only modify files ? Thanks for response – bhushan May 31 '16 at 04:48
  • You can add something along the lines of this answer to a cronjob: http://unix.stackexchange.com/questions/146282/rsync-to-copy-files-which-has-changed – Heilla Jun 03 '16 at 09:04