The utility commands allow you to run and monitor Application Controller utilities through the eaccmd tool.

There are three kinds of Utility commands: Shell, Copy, and Archive.

The List Directory Contents command lets you see the contents of directories on remote machines. Its behavior is similar to that of ls on UNIX, although some non-ls restrictions, noted below, apply.

The Shell utility allows you to run arbitrary commands in a host system shell.

The Copy utility uses an internal Web services interface to copy files or directories, either locally or between machines.

Commands

Description

start-util --type copy --app app_id [--token token] [--recursive] --from host_id --to host_id --src file_pattern --dest dest_path

As part of the Copy utility, starts a copy. You identify the hostname, port, and path for both the source and destination directories. If the copy is local, you do not need to specify the host_id.

Keep in mind that you are not necessarily copying to the machine you are running eaccmd on. The hosts you are copying to and from are those you specified in your provisioning file.

--token is a string used to stop the utility or get its status. If you do not specify a token, one is generated and returned when you start the utility.

If --recursive is specified, it indicates that the Copy utility recursively copies any directories that match the wildcard.

If --recursive is not specified, the Copy utility does not copy directories, even if they match the wildcard. Instead, it creates intermediate directories required to place the copied files at the destination path.

--src is a string representing the file, wildcard, or directory to be copied. A --src must start with an absolute path, such as C:\ or /. A --src can contain . or .. as directory names, and expands * and ? wildcards.

Note the following:

--dest is the full path to the destination file or directory. --dest must be an absolute path, and no wildcards are allowed.

If --dest is a directory, that directory must exist, unless the following conditions are met:

stop-util --app app_id --token token

Stops a Copy utility. The token is a string, either user-created or generated and returned when you start the utility, that eaccmd prints to screen. The token can be used to stop the utility or to get its status.

status-util --app app_id --token token

Gets the status of a Copy utility. The token is a string, either user-created or generated and returned when you start the utility, that eaccmd prints to screen. The token can be used to stop the utility or to get its status.

This section illustrates several different Copy actions. For simplicity, the majority of the Copy actions are done on a single machine. The final example shows how to copy across machines.

First, assume the following directory structure exists on the source:

/
	endeca1/
		work/
			dgraphlogs/
				a.log
			forgelogs/
				b.log
	endeca2/
		work/
			dgraphlogs/
				c.log
			forgelogs/
				d.log
				e.log
	destination/

The following command copies one file to a new name:

eaccmd start-util --type copy --app myApp  
   --src "/endeca1/work/dgraphlogs/a.log" --dest "/destination/out.log"

The resulting directory change would look like this:

	destination/
		out.log

The following command copies one file into an existing directory:

eaccmd start-util --type copy --app myApp 
   --src "/endeca1/work/dgraphlogs/a.log" --dest "/destination"

The resulting directory change would look like this:

destination/
	a.log

The following command recursively copies a directory to a new name:

eaccmd start-util --type copy --app myApp 
   --src "/endeca1/work/dgraphlogs" --dest "/destination/outlogs" --recursive

The resulting directory change would look like this:

destination/
	outlogs/
		a.log

The following command recursively copies a directory into an existing directory:

eaccmd start-util --type copy --app myApp 
   --src "/endeca1/work/dgraphlogs" --dest "/destination"
   --recursive

The resulting directory change would look like this:

destination/
	dgraphlogs/
		a.log

The following command copies all files in a directory.

eaccmd start-util --type copy --app myApp 
   --src "/endeca2/work/forgelogs/*" --dest "/destination"

The resulting directory change would look like this:

destination/
		d.log
		e.log

The following copy command demonstrates the use of multiple wildcards:

eaccmd start-util --type copy --app myApp 
   --src "/e*/work/*logs/*.log" --dest "/destination"

The resulting directory change would look like this:

destination/
		a.log
		b.log
		c.log
		d.log
		e.log

The following copy demonstrates a recursive copy with wildcards:

eaccmd start-util --type copy --app myApp 
   --src "/e*/work" --dest "/destination" --recursive

The resulting directory change would look like this:

destination/
	work/
		dgraphlogs/
			a.log
			c.log
		forgelogs/
			b.log
			d.log
			e.log

When copying to another machine, the syntax is as follows:

eaccmd start-util --type copy --app myApp --from ITLHost --to MDEXHost 
   --src /full/path/to/file/src.txt --dest /full/path/to/file/dest.txt

Keep in mind that the hostnames are not IP addresses or DNS names, but rather are the hosts that are defined within the EAC. If you are using the Deployment Template, these are the hosts defined in the AppConfig.xml file with tags similar to this example:

<host id="ITLHost" hostName="itl.example.com" port="8888" />
<host id="MDEXHost" hostName="mdex.example.com" port="8888" />

Also make sure that you have a clear network path between hosts (if necessary, make the appropriate modifications in any firewall to allow traffic).

This topic provides details about how the Copy utility works.

The Copy utility supports wildcards (* and ?) and recursive copying. In some cases, the destination directory must already exist; in others, the utility automatically creates both the destination directory and any empty directories in the transfer.

Directories are copied first to a temporary directory on the destination machine before being copied one file at a time to the target location. You can configure the location of this temporary directory in the eac.properties file, using the optional setting com.endeca.eac.filetransfer.fileTransferTempDir as follows:

If the Copy utility tries to copy a file to a location where another file already exists, the utility overwrites the preexisting file.

The Archive utility allows you to archive and roll back directories.

Using the Archive utility, you can save off and back up a set of component outputs, which later can be rolled back on demand. With the backup operation, you create back up copies of directories distinguished by time stamps. With the rollback operation, you replace the current version of a directory with the most recently backed-up version. The current version is then renamed with an .unwanted suffix.

Backup operations create an archive directory from an existing directory.

Backup operations create an archive directory from an existing directory. The archive directory has the same name as the original directory, but with a timestamp appended to the end. The timestamp reflects the time when the backup operation was performed.

For example, if the original directory is called logs and was backed up on October 11, 2008 at 8:00 AM, the backup operation creates a directory called logs.2008_10_11.08_00_00.

Rollback operations roll back the directory to the most recent backed up version.

For example, say you have a directory called logs, one called logs.2008_10_11.08_00_00, and other, older versions. When you roll back, the following things happen:


Copyright © Legal Notices