This simple Hy script syncs a local directory with a remote directory designated by the user. (Thus, it is a client program rather than a server program.) Use this script as follows:
- At local:
pip install hy paramiko scp
- At remote:
apt-get install tree
orbrew install tree
, depending on OS
- At the local machine, place the script at a directory you want to sync with the remote directory.
- Run the script as
hy sync.hy
- Provide the followings as prompted:
- Remote address
- Remote username
- Remote port number (recall that ssh's port number defaults to 22)
- Remote password
- Target remote directory as absolute path
This script does the following:
- Creates subdirectories in local dir not present in remote dir
- Creates subdirectories in remote dir not present in local dir
- Uploads files in local dir not present in remote dir
- Downloads files in remote dir not present in local dir
thus syncing the two directories.