copy

To copy any file from a source to a destination, use the copy command in the EXEC mode. The copy command in the Cisco CDA copies a configuration (running or startup).

Running Configuration

The Cisco CDA active configuration stores itself in the Cisco CDA RAM. Every configuration command you enter resides in the running configuration. If you reboot your Cisco CDA server, you lose the running configuration. If you make changes that you want to save, you must copy the running configuration to a safe location, such as a network server, or save it as the Cisco CDA server startup configuration.

Startup Configuration

You cannot edit a startup configuration directly. All commands that you enter store themselves in the running configuration, which you can copy into the startup configuration.

In other words, when you boot a Cisco CDA server, the startup configuration becomes the initial running configuration. As you modify the configuration, the two diverge: the startup configuration remains the same; the running configuration reflects the changes that you have made. If you want to make your changes permanent, you must copy the running configuration to the startup configuration.

The following command lines show some of the copy command scenarios available:

copy running-config startup-config—Copies the running configuration to the startup configuration.

copy run startReplaces the startup configuration with the running configuration.

Note If you do not save the running configuration, you will lose all your configuration changes during the next reboot of the Cisco CDA server. When you are satisfied that the current configuration is correct, copy your configuration to the startup configuration with the copy run start command.

copy startup-config running-configCopies the startup configuration to the running configuration.

copy start runMerges the startup configuration on top of the running configuration.

copy [protocol://hostname/location] startup-config—Copies but does not merge a remote file to the startup configuration.

copy [protocol://hostname/location] running-config—Copies and merges a remote file to the running configuration.

copy startup-config [protocol://hostname/location]—Copies the startup configuration to a remote system.

copy running-config [protocol://hostname/location]—Copies the running configuration to a remote system.

copy logs [protocol://hostname/location]—Copies log files from the system to another location.

Note The copy command is supported only for the local disk and not for a repository.

Syntax Description

copy

The command that copies items.

running-config

Represents the current running configuration file.

startup-config

Represents the configuration file used during initialization (startup).

protocol

See Table 4-2 for protocol keyword options.

hostname

Hostname of destination.

location

Location of destination.

logs

The system log files.

all

Copies all Cisco CDA log files from the system to another location. All logs are packaged as cdalogs.tar.gz and transferred to the specified directory on the remote host.

filename

Allows you to copy a single Cisco CDA log file and transfer it to the specified directory on the remote host, with its original name.

log_filename

Name of the Cisco CDA log file, as displayed by the show logs command (up to 255 characters).

mgmt

Copies the Cisco CDA management debug logs and Tomcat logs from the system, bundles them as mgmtlogs.tar.gz, and transfers them to the specified directory on the remote host.

runtime

Copies the Cisco CDA runtime debug logs from the system, bundles them as runtimelogs.tar.gz, and transfers them to the specified directory on the remote host.

Defaults

No default behavior or values.

Command Modes

EXEC

Usage Guidelines

The fundamental function of the copy command allows you to copy a file (such as a system image or configuration file) from one location to another location. The source and destination for the file specified uses the Cisco CDA file system, through which you can specify any supported local or remote file location. The file system being used (a local memory source or a remote system) dictates the syntax used in the command.

You can enter on the command line all the necessary source and destination information and the username and password to use; or, you can enter the copy command and have the server prompt you for any missing information.

Timesaver Aliases reduce the amount of typing that you need to do. For example, type copy run start (the abbreviated form of the copy running-config startup-config command).

The entire copying process might take several minutes and differs from protocol to protocol and from network to network.

Use the filename relative to the directory for file transfers.

Possible errors are standard FTP or SCP error messages.

Table 4-2 Protocol Prefix Keywords

Keyword

Source of Destination

ftp

Source or destination URL for FTP network server. The syntax for this alias:

ftp:[[[//username [:password]@]location]/directory]/filename

scp

Source or destination URL for SCP network server. The syntax for this alias:

scp:[[[//username [:password]@]location]/directory]/filename

sftp

Source or destination URL for an SFTP network server. The syntax for this alias:

sftp:[[//location]/directory]/filename

tftp

Source or destination URL for a TFTP network server. The syntax for this alias:

tftp:[[//location]/directory]/filename

Examples

Example 1

/admin# copy run start

Generating configuration...

/admin#

Example 2

/admin# copy running-config startup-config

Generating configuration...

/admin#

Example 3

/admin# copy start run

/admin#

Example 4

/admin# copy startup-config running-config

/admin#

Example 5

/admin# copy logs disk:/

Collecting logs...

/admin#

Example 6

/admin# copy disk://mybackup-100805-1910.tar.gz ftp://myftpserver/mydir

Username:

Password:

/admin#

Related Commands

Command

Description

application install

Starts or stops a Cisco CDA instance.

backup

Performs a backup (Cisco CDA and Cisco ADE OS) and places the backup in a repository.

delete

Deletes a file from the Cisco CDA server.

dir

Lists a file from the Cisco CDA server.

reload

Reboots the system.

restore

Restores from backup the file contents of a specific repository.

show application

Shows application status and version information.

show version

Displays information about the software version of the system.