ECFS is ECMWF's File Storage system. ECFS is a file oriented client-server application, providing facilities to archive and retrieve files between HPC/ECS and the Data Handling System (DHS), which is based on HPSS (High Performance Storage System). The system is non-transparent: you must issue explicit commands to store files into ECFS, or to retrieve them back into local (client) storage.

ECFS files are stored in domains. Currently two domains are available to users.

ec:The permanent domain where files are stored indefinitely. This is the default domain.
ectmp:The temporary domain where files are stored for 90 days, after which they are automatically deleted. Note that once a file has been deleted it CANNOT be recovered.

The domain names shown above (ec:, ectmp:) are used in the various ECFS commands to indicate which domain you are working with.

Note that, as an alternative, the ectmp: domain can be referenced by ec:/TMP. Thus ectmp:/uid/newdir and ec:/TMP/uid/newdir are equivalent:

Files copied into ECFS are first stored on disk within ECFS and then on to magnetic tape. When a file is retrieved from ECFS it is first copied from tape on to cache disk within ECFS, then to the client system. Thus multiple retrieves of the same file will require only one read from tape, all subsequent copies being satisfied from the disk cache.

ECFS supports the transport of files between various clients and the ECFS storage system. However, the transport of files between clients is not supported.

ECFS is available on AIX, Linux and other platforms, and supports C- , Korn- and bash-shell environments.

Files transferred between a client and ECFS storage can be up to 128 GiB in size.

ECFS file names can contain the following characters: letters (A-Z,a-z), numbers (0-9), underscores (_), commas (,), periods (.) and plus and minus signs (+, -).

If an ECFS command fails due to a recoverable error (HPSS down, network problems, etc.), the ECFS client will retry the command until it succeeds.

ECaccess allows users to transfer files between their remote host and an ECFS domain at ECMWF.

ECFS commands

The Unix style of file interface has been adopted by ECFS:

  • files are mapped to a Unix-compatible directory tree
  • either absolute and relative pathnames can be used
  • there is a current ECFS working directory, analogous to the Unix current working directory $PWD
  • limited wildcard support is provided.

In ECFS the well-known Unix file management commands simply become:

els, erm, ermdir, emkdir, ecd, epwd, echmod, echgrp, ecp, emv (and emove), ecat, etest, etouch and eumask.

In addition the following ECFS commands are available:

ecfsdir, ecfs_status

All available ECFS commands are described in more detail in the relevant man pages:

ecat Copy files between a domain and STDIN/STDOUT
ecd Change the current ECFS working directory
ecfs_status Get status on ECFS usage (on server only)
ecfsdir Archive or retrieve a complete UNIX directory as one ECFS file
echgrp Change the group ownership of an ECFS file or directory
echmod Change the permissions of a ECFS file or directory
ecp Copy files across ECFS domains, including UNIX
els List ECFS files
emkdir Create empty ECFS directories
emove Rename files or directories within an ECFS domain
emv Move files across ECFS domains, including UNIX
epwd Display the current ECFS working directory for the relevant domain
ermdir Remove empty ECFS directories
erm Remove ECFS files
etest Check file types and compare file attributes
etouch Change file timestamps
eumask Change the current ECFS umask

File name 'globbing'

File name globbing refers to the ability of Unix shells to allow users to specify a single pattern that expands to a list of file names that match that pattern. The typical case is the '*' character: A specification of, for instance, file* will expand to a list of all local files whose names, such as file1 or file_X, match that pattern.

With the client version 2 globbing is now left to the calling shell so that a command usually passes the expanded set of files to the client. (Should a user have disabled such expansion, the client receives just the character '*'.)

It is strongly recommended to use an explicit domain name (ec: or ectmp:) to specify ECFS files; rather than a potentially failing 'els file*' you should use 'els domain:file*' (in csh, 'els "domain:file*"').

Backup support

By default files saved in ECFS will not have a backup copy created.

If you want to protect essential data (that cannot easily be regenerated should the primary copy become unreadable) by creating a backup copy, you have to specify the option -b on the ecp and emv commands!

The existence of backup copies will be indicated by the first character of the els -l output:

- for files with no secondary copy;
b for files with a secondary copy.

e.g.

 br--r----- 1 uid group 510 Nov 19 2012 essential_data
 -r--r----- 1 uid group 510 Nov 19 2012 unimportant_data

NOTE: Files are removed from ECFS with a soft-delete: files will still be kept for some time (currently 30 days) during which it will be possible, on request, to un-delete any file that was removed/deleted by mistake. After that period any removal will become permanent, irrespective of the existence of backup copies.

ECFS usage monitoring

The ecfs_status command will give you the most recent status on ECFS usage for your default project account. For more information please call ecfs_status -h.

To get an overview on your ECFS usage, you can also refer to your audit files ec:ecfs_audit and/or ectmp:ecfs_audit.tmpEach ECFS user has an ecfs_audit file, placed in each of their ECFS domains. These files contain a list of all files you own in the relevant ECFS domai, excluding any backup copies. To list the audit file in your ec: domain use the following command:

els -la ec:ecfs_audit

Small audit files can be inspected quickly using the ecat command, e.g.

ecat ec:ecfs_audit - | less 

To examine the audit file in more detail you might want to copy it to your disk space in $HOME, $PERM or $SCRATCH, e.g. :

ecp ec:ecfs_audit $SCRATCH

For a complete list of available ECFS commands please refer to the ECFS user documentation or read the relevant man pages on ecgate.

The ecfs_audit file lists your files (no directories) in the format

--    uid gid        size(bytes) creation    last_access path    today=2018-09-13
...
*+    uid gid            114176  20120307     20120702  /uid/directory1/file1
*     uid gid            114176  20120307     20120702  /uid/directory2/file1
b+    uid gid             19363  20141208     20141208  /uid/directory2/file2
...
Total files =924    gigabytes = 282.40779780224
total directories = 52 total files not accessed since 20170312 = 865

where the columns have the following meaning:

ColumnComment
--

Attribute:

b  - file is backed-up
+  - file has not been accessed for over 18 months
*  - file is not backed-up

uid User-id of the file's owner
gid The file's Unix group
size(bytes) 
File size in bytes
creation 
File creation date in format YYYYMMDD
last_access 
Date of last access, e.g. read, in format YYYYMMDD
path 
Full path with a file name in ec:

The audit file's creation date in the format "today= YYYY-MM-DD" is stated in its first line. At the bottom the total of your ECFS content is reported in terms of number and (binary) volume. The very last line gives the number of directories and the number of files not accessed for 18 months.


In addition, you might want to use the new ecfs_filter tool to help analyse and/or delete your ECFS files or use the web based ECFS Data Management tool (web login with your computer user-ID required).

Using ECFS in scripts

All ECFS commands specifying a single operation return the value 0 if successful, and an error code > 0 otherwise. However, as with Unix, ECFS commands may specify a number of operations, either due to multiple arguments or to wildcard expressions. In such cases, ECFS will always attempt to carry out all operations, even if some intervening operations are not successful. If all such operations for a command are successful, the return code will be 0; if some of the operations are not successful, the return code will be 1; if fatal errors are incurred, the entire command is discontinued, and the error number > 1 is returned with an explanatory message.

Optimising ECFS read access

If you want to extract large amounts of data from ECFS, we would recommend you to transfer the files in the order in which they are written to tapes. This can be done with the '–order=tape' option of the ecp and emv commands. This option is also available for the els command,

Listing files - example

ecd ec:<ecfs_path_name>
els -l --order=tape ec:2020010100/f*

Note that the path name given to 'els' should be relative. This command shows the files selected with the tape number they are written to together with their position on tape. Files on disk are have no tape information. E.g.:

# ECFS files on disk
2020100100/file1
2020100100/file2
# files on tapes
2020100100/file3 volser:J12551 fileno:144 offset:450852437
2020100100/file4 volser:J12551 fileno:144 offset:505435733
2020100100/file5 volser:J12805 fileno:223 offset:29688824476
2020100100/file6 volser:J12805 fileno:223 offset:42359779994

Getting files

ecd ec:<ecfs_path_name>

cat>sourcelist<<eof
ec:2020100100/f*
ec:2020100106/f*
ec:2020100112/f*
ec:2020100118/f*
...
eof

ecp --order=tape -F sourcelist <local_directory>

Note that you have to use the '-F sourcelist' option.

Error handling

The following techniques are suggested for trapping ECFS error codes when running batch scripts in the Korn shell environment:

Set a trap for the entire script:

trap " echo ECFS call exited with RC= \$? " ERR

or catch any errors on each call:

set +e
ecp nofile ec:
RC=$?
set -e
if [ $RC -gt 0 ]
  then
  echo " ECFS call exited with RC= $RC"
fi

DOs and DON'Ts

  • DON'T archive many small files separately. ECFS is most efficient at handling a small number of large files. Thus 
  • DO tar and compress (or gzip) many small files into one large file when archiving (say) a directory or use the ecfsdir command. 
  • DON'T copy in/out the same files frequently.
  • If you wish to archive files for a short period only (less than 90 days) DO store them in the ectmp: domain. Then they will be automatically deleted after 90 days without any further action from you.
  • Check the existence of a local copy before getting the ECFS version of a file:

    #!/bin/ksh
    if [ ! -r $SCRATCH/myfile ]
    then
      ecp ec:myfile $SCRATCH/.  
    fi
    
  • If it is required to store a large number ( > 5000) of files into ECFS then DO contact the ECMWF Support Portal in advance to discuss the most efficient way to store/retrieve this large number.



7 Comments

  1. Is ''ecp'' able to check, whether a file is already on disk, before downloading data from ECFS or will it copy the file in any case?

    1. By default ecp will not overwrite any existing file, please see ecp or the relevant man page.

  2. Where does "large" start, w.r.t. file size? In other words, what is the acceptable range for a file size on ECFS?

  3. is there a command that tests whether a file is present, -s $file on a linux file system?

  4. Is there a command like 'wget' for ECFS, for a direct download?

    1. There is the command ecaccess-file-get, which is part of the ECaccess web toolkit. Note that it is not a direct download: the ECFS file will first be copied with ecp to Atos in Bologna, then transferred to your local site.