If your like me, sometimes you can not test the code your writing on your workstation and the code need to be 'installed' or 'deployed' to a remote server in order to test it because of hardware constrain or physical environment (IO, network,...).

The following is a simple shell script that will monitor a local path and rsync it to a remote server when a file is changed. It can also remote execute some commands (like restarting services for example).

local_path: Local path from where the files will be copied from (required)remote_user: Remote user to use for rsync (required)remote_server: Remote server (IP of FQDN) (required)remote_path: Remote path where the files will be copied to (required)remote_script: Remote script to execute after syncing the files (optional) Script mus…