Menu

#1 pydcp: Command-line options considered bad

open
nobody
None
5
2007-09-14
2007-09-14
Jens Engel
No

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/

Discussion

  • Jens Engel

    Jens Engel - 2007-09-14

    Patched file that provides this functionality (and some other patches).

     
  • josh w

    josh w - 2009-12-21

    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}" $@

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.