pydcp: Command-line options considered bad
Status: Beta
Brought to you by:
davevehrs
The command-line options to copy a file to/from remote hosts is currently unnecessary complex/unnatural:
pydcp ... --scp_mode=send --scp_local=my/file --scp_remote=/tmp
It would be far more natural to mimic cp/scp usage:
scp my/file remote_host1:/tmp
Because the copy command is applied to multiple hosts, you need a placeholder to indicate the remote side.
Therefore, the desired command-line syntax should be:
# mode=send: Copy a file to a number of remote hosts
pydcp ... my/file remote:/tmp
# mode=get: Copy a file from a number of remote hosts
pydcp ... remote:/tmp/my.log ~/tmp/
Patched file that provides this functionality (and some other patches).
Could also do this with a wrapper shell script, such as pysend.sh:
#!/bin/sh
## pysend.sh /tmp/my.log /tmp/ ...
## becomes
## pydcp --scp_mode=send --scp_local=my/file --scp_remote=/tmp/ ...
## Which copies $1 (my/file) to remote nodes as $2 (/tmp/).
local_file="$1"
shift
remote="$1"
shift
echo "send local ${local_file} ==> remote:${remote} "
pydcp --scp_mode=send --scp_local="${local_file}" --scp_remote="${remote}" $@