aterm-download

aterm-download is a wrapper scripting based on Arcitecta aterm.jar to download data from mediaflux. It is included in unimelb-mf-clients software package.


Synopsis

aterm-download: 
	synopsis:
		Exports one or more assets using a specified profile.

	usage:
		aterm-download [<args>] <file> [<create-args>]

	arguments:
		-lp <local profile>
			[optional] A local profile (ecp) containing a specification for the export.
		-mode [test|live]
			[optional] Is this a test or a live export? Test export can be used to check whether a profile is correct. Defaults to 'live'.
		-ncsr <nb>
			[optional] The number of concurrent server requests. A number in the range [1,infinity].
			Defaults to 1. Concurrent requests can increase performance as data is downloaded parallel to request processing.
		-where <query>
			[optional] Query that will return the assets for export/download. Any query conforming to AQL is valid. Must be specified if 'namespace' argument is omitted.
		-namespace <namespace>
			[optional] The asset namespace to export. Must be specified if 'where' argument is omitted
		-onerror [abort|continue]
			[optional] If there is an export error, what should happen? Defaults to 'abort'.
		-onlocalerror [abort|continue]
			[optional] If there is an error accessing or opening a local file (e.g. permissions, etc), what should happen? Defaults to 'abort'.
		-task-name <task name>
			[optional] Specifies the custom name for the task that monitors the progress of the export. User may track the progress of the task by using server.task.named.describe :name <task name>.
		-task-remove-after <hours>
			[optional] Used to specify how many hours after the export is complete do we want the monitoring task to be removed from the system. Defaults to '0' hours, i.e. now.
		-task-batch-size <batch size>
			[optional] When used task that monitors the progress of the export will update the progress after 'task-batch-size' of work units were completed. Defaults to '100' work units.
		-task-count-assets <true|false>
			[optional] Specifies if the assets should be counted before the export begins. This is used by task that tracks the progress of the export so that it can know total number of work units (file transfers). Defaults to 'false'.
		-task-report-bytes <true|false>
			[optional] Specifies if the task should include bytes transferred as well when updating progress, not just assets transferred. If set to true, bytes transferred will be reported once every second. Defaults to 'false'.
		-verbose [true|false]
			[optional] If set to true, will display those files being consumed. Defaults to false.
		-export-empty-namespaces [true|false]
			[optional] Specifies whether or not to export empty namespaces. If set to true, folders will be created for empty namespaces. This only works in conjunction with -namespace argument. It will be ignored if either of -lp or -where arguments are provided. Defaults to false.
		-folder-layout [none|collection]
			[optional] Specifies the folder layout for exported files. Ignored if '-lp' provided. Defaults to 'collection'.
		-filename-collisions [skip|rename|overwrite]
			[optional] Specifies how to handle filename collisions. Ignored if '-lp' provided. Defaults to 'rename'.
		-ns-parent-number
			[optional] When folder layout is set to 'collection' this argument specifies the number of collection parents to include. Defaults to infinity, i.e. all parents.


Configuration

To get aterm-download script, unimelb-mf-clients must be installed. For spartan HPC users, it is already installed and you just need to load the module:

module load unimelb-mf-clients


You also need to create a configuration file in $HOME/.Arcitecta/mflux.cfg

mkdir -p ~/.Arcitecta/
touch ~/.Arcitecta/mflux.cfg

The mflux.cfg file should contain the server details and user domain (unimelb for staff, student for students) and user name, see example below:

host=mediaflux.researchsoftware.unimelb.edu.au
port=443
transport=https
domain=unimelb
user=UNI_USERNAME

Once the configuration file is created correctly, you can start using the aterm-download command in terminal.

Examples

Download a directory (asset namespace)

The command below downloads directory (asset namespace) /projects/proj-demonstration-1128.4.15/test-data from Mediaflux to current local directory:

aterm-download -verbose true -ns-parent-number 1 -namespace "/projects/proj-demonstration-1128.4.15/test-data" ./


Download individual files (assets)

To download an individual file (asset) /projects/proj-demonstration-1128.4.15/test-data/sample-file1.tar.gz from Mediaflux to current local directory:

aterm-download -ns-parent-number 0 -where "namespace='/projects/proj-demonstration-1128.4.15/test-data' and name='sample-file1.tar.gz'" ./