What is Workspace Rsync ?
Simple and lightweight bash script can help to quick sync a change from local workspace to remote workspace. , support to upload resource to and download resource from remote workspace. Another useful of the tool is support to quickly run command on remote workspace.
Features:
-
Automatically sync up my local working space (directories) to remote working space
-
Configure your local working directories
-
Configure your remote working directories
-
configure ssh account with private key to use rsync/scp for download/update files
-
Inotify/monitoring changing happend in your local working dir and update to remote working dir
-
-
Support to sync up the whole working dir from remote to local and otherwise
-
Support configure file for auto-reload the previous configure
-
Saving the configure file to <Local Workspace>/.ws-rsync, Auto apply the configuration from there when user run the utility on configured workspace
-
If the local has not the workspace matching with remote side, then ask user to allow for downloading the remote side. And otherwise. if remote has not the Workspace which existed on local, the ask user to allow for uploading the local version to remote. But I will follow the simple methology here that Remote Side always have the latest version, The local will always clone workspace from remote side.
-
Support local rsync. In the case, don’t need push any infomation in --ssh-acc/--ssh-pass/--ssh-key , the ws-rsync will becall in local
-
Support remote command call : Run command on remote
Getting start
Install
Ideally, the utility is not dependency on any other tools.
But if your remote side is not support private key/public key pair for authentication then you should use ssh password for authentication.
Then you need sshpass
Another side is how the ws-rsync daemon know about there have a changed/create file.
I used find with diff_time pooling mechanism to check the status of files in local side.
But there will have window time diff_time to the next check If you want the process more realtime, then you need inotify-tools
#dependency to run ssh with password authentication
sudo apt install sshpass inotify-tools
sudo make installConfigure and run the utility
# for use ssh key to authentication
ws-rsync init
ws-rsync config
ws-rsync startSub-Commands
Force download from remote
ws-rsync download <workspace_file_path>-
Example:
ws-rsync download /home/kevin/Project/KEVIN/Workspace/KenCanCode/version.h ws-rsync download ./version.h
Upload to remote workspace
Upload workspace_file_path to remote, support relative/absolute path
ws-rsync upload <workspace_file_path>-
Example:
ws-rsync upload /home/kevin/Project/KEVIN/Workspace/KenCanCode/version.h ws-rsync upload ./version.h
