ucp – Copying files/directories
Purpose
ucp is a script that copies files or directories. It is an
URL-enabled version of the cp system command. Via ll.url
and
ll.orasql
ucp supports ssh
and oracle
URLs.
Options
ucp supports the following options:
- urls
Two or more URLs. If more than two URLs are given or the last URL refers to an existing directory, the last URL is the target directory. All other sources are copied into this target directory. Otherwise one file is copied to another file.
- -v <flag>, --verbose <flag>
Give a report during the copy process about the files copied and their sizes? (Valid flag values are
false
,no
,0
,true
,yes
or1
)
- -c <mode>, --color <mode>
Should the output be colored? If
auto
is specified (the default) then the output is colored if stdout is a terminal. Valid modes areyes
,no
orauto
.
- -g <group>, --group <group>
A group id or name. If given ucp will change the group of the target files.
- -r <flag>, --recursive <flag>
Copies files recursively. (Valid flag values are
false
,no
,0
,true
,yes
or1
)
Examples
Copy one file to another:
$ ucp foo.txt bar.txt
Copy a file into an existing directory:
$ ucp foo.txt dir/
Copy multiple files into a new or existing directory (and give a progress report):
$ ucp foo.txt bar.txt baz.txt dir/ -v
ucp: foo.txt -> dir/foo.txt (1,114 bytes)
ucp: bar.txt -> dir/bar.txt (2,916 bytes)
ucp: baz.txt -> dir/baz.txt (35,812 bytes)
Recursively copy the schema objects in an Oracle database to a local directory:
$ ucp oracle://user:pwd@oracle.example.org/ db/ -r
Recursively copy the schema objects in an Oracle database to a remote directory:
$ ucp oracle://user:pwd@oracle.example.org/ ssh://user@www.example.org/~/db/ -r