HMC Manual Reference Pages  - CPFILE (1)

NAME

cpfile - copy file

CONTENTS

Synopsis
Description
Options
Examples
Environment
Bugs
Author
See Also

SYNOPSIS

cpfile -t {fcs | modelmap | vpp} -l {l | r} -f file-name
-o {import | export}
[-h host-name -u user-ID [--passwd password] [-k SSH-private-key]]
[-r] [--help]

DESCRIPTION

cpfile copies a file to or from the Hardware Management Console (HMC) and the local HMC file system, removable media, or a remote system using secure File Transfer Protocol (SFTP).

This command allows a user to copy a file to or from a directory on the HMC to which the user does not have write access. The type of file specified determines the directory.

OPTIONS

-t The type of file to copy.

Specify fcs to copy the certificate used for HMC to HMC communication. An HMC restart is required to apply an imported certificate on this HMC. After this HMC is restarted, communication from this HMC to other HMCs cannot be reestablished until this certificate has been applied to the other HMCs.

Specify modelmap to copy an XML file which indicates the HMC is managing an IBM Smart Analytics Solution. This file describes an appliance model ID and its associated server model ID and is used during a call-home event to associate the failing server model to the appliance model.

Specify vpp to copy a zip file of Virtualization Protection Profile (VPP) audit log files. When importing a VPP audit log zip file, the file is unzipped into the user’s home directory on the HMC.

-l The location of the file. For an import operation, this is the source location of the file. For an export operation, this is the destination location of the file. Valid values are l for the local HMC file system or removable media, or r for a remote SFTP server.

When copying a file to or from removable media, the media must be present in the removable media device and the device must be mounted with the mount command before this command is issued. The lsmediadev command can be used to display all of the removable media devices on the HMC.

-f The fully qualified name of the file to copy. If the file already exists in the destination location, it will be overwritten.

When -t fcs is specified, the file name must end with the .jks suffix.

When -t modelmap is specified, the file name must end with the .xml suffix.

When -t vpp is specified, the file name must end with the .zip suffix.

-o The direction of the copy. Valid values are import to copy the file from the specified location to the destination location on the HMC, or export to copy the file from the source location on the HMC to the specified location.
-h The host name or IP address of the SFTP server.

This option is required when copying a file to or from an SFTP server. Otherwise, this option is not valid.

-u The user ID to use to log in to the SFTP server.

This option is required when copying a file to or from an SFTP server. Otherwise, this option is not valid.

--passwd The password to use to log in to the SFTP server.

If both this option and the -k option are omitted when copying a file to or from an SFTP server, you will be prompted to enter the password. The --passwd and -k options are mutually exclusive.

This option is only valid when copying a file to or from an SFTP server.

-k The name of the file that contains the SSH private key. If the file name is not fully qualified, the file must exist in the user’s home directory on the HMC.

Use the ssh-keygen command to generate the public and private SSH key pair. The ssh-keygen command is not allowed to write to the .ssh directory in the user’s home directory on the HMC, so when you run the command on the HMC, you must specify both the directory and the file name for the private key. If you generate a key with a passphrase, you will be prompted to enter the passphrase when you run any HMC command that uses the key.

If both this option and the --passwd option are omitted when copying a file to or from an SFTP server, you will be prompted to enter the password. The -k and --passwd options are mutually exclusive.

This option is only valid when copying a file to or from an SFTP server.

-r When importing the certificate used for HMC to HMC communication, specify this option to cause the HMC to automatically be restarted without asking for confirmation.
--help Display the help text for this command and exit.

EXAMPLES

Copy the model mapping file called hmcModelMap.xml on a USB flash memory device (the USB flash memory device must already be connected to the HMC) to the HMC:

lsmediadev (to obtain mount points)

mount /media/sdb1

cpfile -t modelmap -l l -o import -f /media/sdb1/hmcModelMap.xml

Use scp to copy the model mapping file called myfile.xml to the user’s home directory on the HMC. Then use cpfile to copy the file into the model mapping file directory on the HMC:

scp remoteuser@remotehostname:/directory/myfile.xml /home/user

cpfile -t modelmap -l l -o import -f /home/user/myfile.xml

Copy the model mapping file on the HMC to the file /home/maps/map.xml on a remote SFTP server (you will be prompted to enter your password):

cpfile -t modelmap -l r -o export -f /home/maps/map.xml
-h sftpserver -u sftpuser

Copy the certificate used for HMC to HMC communication to a remote SFTP server:

cpfile -t fcs -l r -o export -f /home/fcs/hmcChatlet2.jks -h sftpserver
-u sftpuser --passwd sftppassword

Copy the certificate used for HMC to HMC communication from a remote SFTP server and restart the HMC to apply this certificate:

cpfile -t fcs -l r -o import -f /home/fcs/hmcChatlet2.jks -h sftpserver
-u sftpuser --passwd sftppassword -r

Copy the VPP audit logs on the HMC into a zip file on a remote SFTP server using SSH keys for authentication::

cpfile -t vpp -l r -o export -f /home/vpp/auditLogs.zip -h sftpserver
-u sftpuser -k /home/hmcuser/keys/id_rsa

ENVIRONMENT

None

BUGS

None

AUTHOR

IBM Austin

SEE ALSO

chhmccert, lsmediadev


Linux CPFILE (1) November 2023
Generated by manServer 1.07 from cpfile.1 using man macros.