Comment 0 for bug 1400928

Revision history for this message
Robert Bruce Park (robru) wrote :

The second example given by 'juju help scp' says that there is a recursive option, -r:

$ juju help scp
usage: juju scp [options] <file1> ... <file2> [scp-option...]
purpose: launch a scp command to copy files to/from remote machine(s)

options:
-e, --environment (= "")
    juju environment to operate in
--proxy (= true)
    proxy through the API server
--pty (= true)
    enable pseudo-tty allocation

Launch an scp command to copy files. Each argument <file1> ... <file2>
is either local file path or remote locations of the form <target>:<path>,
where <target> can be either a machine id as listed by "juju status" in the
"machines" section or a unit name as listed in the "services" section.
Any extra arguments to scp can be passed after at the end. In case OpenSSH
scp command cannot be found in the system PATH environment variable, this
command is also not available for use. Please refer to the man page of scp(1)
for the supported extra arguments.

Examples:

Copy a single file from machine 2 to the local machine:

    juju scp 2:/var/log/syslog .

Copy 2 files from two units to the local backup/ directory, passing -v
to scp as an extra argument:

    juju scp -v ubuntu/0:/path/file1 ubuntu/1:/path/file2 backup/

Recursively copy the directory /var/log/mongodb/ on the first mongodb
server to the local directory remote-logs:

    juju scp -r mongodb/0:/var/log/mongodb/ remote-logs/

Copy a local file to the second apache unit of the environment "testing":

    juju scp -e testing foo.txt apache2/1:

But it does not exist in practise:

$ juju scp -r /whatever/ whereever/
error: flag provided but not defined: -r