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
.
-
-u
<user>
,
--user
<user>
¶ A user id or name. If given ucp will change the owner of the target files.
-
-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
)
-
-x
<flag>
,
--ignoreerrors
<flag>
¶ Ignores errors occurring during the copy process (otherwise the copy process is aborted). (Valid flag values are
false
,no
,0
,true
,yes
or1
)
-
-i
<pattern(s)>
,
--include
<pattern(s)>
¶ Only copy files that match one of the specified patterns.
-
-e
<pattern(s)>
,
--exclude
<pattern(s)>
¶ Don’t copy files that match one of the specified patterns.
-
--enterdir
<pattern(s)>
¶ Only enter directories that match one of the specified patterns.
-
--skipdir
<pattern(s)>
¶ Skip directories that match one of the specified patterns.
-
--ignorecase
<flag>
¶ Perform case-insensitive pattern matching? (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