Cp
(since EVL 1.3)
Copy <source>
to <dest>
, or multiple <source>
(s) to <dest>
directory.
<source>
and <dest>
might be one of:
<local_path> gdrive://<path> gs://<bucket>/<path> hdfs://<path> s3://<bucket>/<path> sftp://<path> smb://<path>
On local files it calls standard ‘cp’ command to copy files, but when <source>
and/or
<dest>
contain URI ‘hdfs://’ (i.e. Hadoop FS), then it calls appropriate commands to
copy from/to such source/destination.
For example when argument starts with ‘s3://’, then it is supposed to be on S3 file system and calls the function ‘evl_s3_cp’, which is by default ‘aws s3 cp’.
So far it can copy to/from local path from/to some specific one or within one URI type. So not yet possible to copy dirrectly for example from S3 to G-Drive.
When more than one <source>
is specified, then URI prefix must be the same for all of them.
- Cp
-
is to be used in EVS job structure definition file or in EWS workflow structure definition.
- evl cp
-
is intended for standalone usage, i.e. to be invoked from command line.
Using this command might keep your code clean, but for more complex copying better use appropriate commands directly, as it gives you all the available options for particular storage or protocol type.
Synopsis
Cp [-f|--force] [-p] <source>... <dest> evl cp [-f|--force] [-p] <source>... <dest> [--verbose] evl cp ( --help | --usage | --version )
Options
- -f, --force
-
destination will be overwritten if exists
- -p
-
preserve mode (i.e. permission), timestamps and ownership
Standard options:
- --help
-
print this help and exit
- --usage
-
print short usage information and exit
- -v, --verbose
-
print to stderr info/debug messages of the component
- --version
-
print version and exit
Examples
These lines in EVL job (an ‘evs’ file):
Cp hdfs:///some/path/to/file /some/local/path/ Cp /some/local/path/file hdfs:///some/path/ Cp hdfs:///some/path/file hdfs:///other/path/ Cp /some/local/path/file /other/local/path/
will call (with handling fails in proper EVL way):
evl_hdfs_get hdfs:///some/path/file /some/local/path/ evl_hdfs_put /some/local/path/file hdfs:///some/path/ evl_hdfs_cp hdfs:///some/path/file hdfs:///other/path/ cp /some/local/path/file /other/local/path/
where defaults for ‘evl_hdfs_*’ variables are:
function evl_hdfs_get { hdfs dfs -get ; } function evl_hdfs_cp { hdfs dfs -cp ; } function evl_hdfs_put { hdfs dfs -put ; }