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'