I wrote this script to keep a file or a folder in sync local or remotely. This worked out very well to sync changes in the code to a remote server in seconds without touching any button on my keyboard. The method to check if anything has changed is even simpler. It checks the file or folder last change date 'ls --full-time'.
Set the variable path to a directory or file. This could be a remote path aswell.
FP_rsync_from='/folder/from'
FP_rsync_to='/folder/to'
#REMOTE
[user]@[remote server]:[remote path]
FP_rsync_from='argonqq@10.10.158.10:/folder/from'
FP_rsync_to='root@10.10.158.11:/folder/to'
After you've started the script it will sync a first time. Now it will only sync if anything changes.