best tool for sync between local and remote server in both directions ubuntu code example
Example: rsync sync remote dir
rsync -a ~/dir1 username@remote_host:destination_directory
rsync -a ~/dir1 username@remote_host:destination_directory