< Home

copy

Function

The copy command copies a file.

The copy command allows downloading files from an HTTP/HTTPS server or uploading files to an HTTP/HTTPS server.

Format

copy source-filename destination-filename [ all ]

copy { source-http-urlname destination-filename | source-filename destination-http-urlname } [ username user-name password password ] (V200R013C00SPC500 or a later version).

copy { source-https-urlname destination-filename | source-filename destination-https-urlname } [ username user-name password password ] ssl-policy ssl-policy (V200R013C00SPC500 or a later version).

Parameters

Parameter

Description

Settings

source-filename

Specifies the path and the name of a source file.

The value is a string of 1 to 160 case-insensitive characters without spaces in the format [ drive ] [ path ] filename. If the string is enclosed in double quotation marks (" "), the string can contain spaces. If the value is a file name, the value is a string of 1 to 64 characters.

In the preceding parameter, drive specifies the storage device name, and path specifies the directory and subdirectory.

You are advised to add : and / between the storage device name and directory. The directory name cannot contain the following characters: ~ * / \ : ' "

destination-filename

Specifies the path and the name of a destination file.

The value is a string of 1 to 160 case-insensitive characters without spaces in the format [ drive ] [ path ] filename. If the string is enclosed in double quotation marks (" "), the string can contain spaces. If the value is a file name, the value is a string of 1 to 64 characters.

In the preceding parameter, drive specifies the storage device name, and path specifies the directory and subdirectory.

You are advised to add : and / between the storage device name and directory. The directory name cannot contain the following characters: ~ * / \ : ' "

all

Copies a file to all member devices.

NOTE:

This parameter is available only in a stack system.

-

username user-name

Specifies the user name used to log in to a server.

The value is a string of 1 to 64 characters.

password paassword

Specifies the password used to log in to a server.

The value is a string of 1 to 64 characters.

source-http-urlname

Specifies the URL of an HTTP server from which a file is downloaded.

The value is a string of 1 to 230 case-insensitive characters without spaces.

destination-http-urlname

Specifies the URL of an HTTP server to which a file is uploaded.

The value is a string of 1 to 230 case-insensitive characters without spaces.

source-https-urlname

Specifies the URL of an HTTPS server from which a file is downloaded.

The value is a string of 1 to 230 case-insensitive characters without spaces.

destination-https-urlname

Specifies the URL of an HTTPS server to which a file is uploaded.

The value is a string of 1 to 230 case-insensitive characters without spaces.

ssl-policy ssl-policy

Specifies the name of an SSL policy.

The value is a string of 1 to 23 case-insensitive characters without spaces.

Views

User view

Default Level

3: Management level

Usage Guidelines

Usage Scenario

The following describes the drive name.

  • drive is the storage device and is named as flash:.

  • If devices are stacked, drive can be named as:

    • flash: root directory of the flash memory of the master switch in the stack.
    • chassis ID#flash: root directory of the flash memory on a device in the stack.

    For example, slot2#flash: indicates the flash memory in slot 2.

The path can be an absolute path or relative path. A relative path can be designated relative to either the root directory or the current working directory. A relative path beginning with a slash (/) is a path relative to the root directory.
  • flash:/my/test/ is an absolute path.

  • /selftest/ is a path relative to the root directory and indicates the selftest directory in the root directory.

  • selftest/ is a path relative to the current working directory and indicates the selftest directory in the current working directory.

Precautions

  • If the destination file name is not specified, the designation file and the source file have the same name. If the source file and the destination file are in the same directory, you must specify the destination file name. If the destination file name is not specified, you cannot copy the source file.

  • If the destination file name is the same as that of an existing file, the system prompts you whether to overwrite the existing file. The system prompt is displayed only when file prompt is set to alert.

Example

# Copy the file config.cfg from the root directory of the flash card to flash:/temp. The destination file name is temp.cfg.

<HUAWEI> copy flash:/config.cfg flash:/temp/temp.cfg
Copy flash:/config.cfg to flash:/temp/temp.cfg?[Y/N]:y
100%  complete.
Info: Copied file flash:/config.cfg to flash:/temp/temp.cfg...Done.

# If the current directory is the root directory of the flash card, you can perform the preceding configuration using the relative path.

<HUAWEI> pwd
flash:
<HUAWEI> dir
Directory of flash:/

  Idx  Attr     Size(Byte)  Date        Time       FileName 
   0   -rw-      6,721,804  Mar 19 2012 12:31:58   devicesoft.cc
   1   -rw-            910  Mar 19 2012 12:32:58   config.cfg
   2   drw-              -  Mar 05 2012 09:54:34   temp
...
65,233 KB total (7,289 KB free)
<HUAWEI> copy config.cfg temp/temp.cfg
Copy flash:/config.cfg to flash:/temp/temp.cfg?[Y/N]:y
100%  complete.
Info: Copied file flash:/config.cfg to flash:/temp/temp.cfg...Done.

# Copy the file config.cfg from the root directory of the flash card to flash:/temp. The destination file name is config.cfg.

<HUAWEI> pwd
flash:
<HUAWEI> dir
Directory of flash:/

  Idx  Attr     Size(Byte)  Date        Time       FileName 
   0   -rw-      6,721,804  Mar 19 2012 12:31:58   devicesoft.cc
   1   -rw-            910  Mar 19 2012 12:32:58   config.cfg
   2   drw-              -  Mar 05 2012 09:54:34   temp
...
65,233 KB total (7,289 KB free)
<HUAWEI> copy config.cfg temp
Copy flash:/config.cfg to flash:/temp/config.cfg?[Y/N]:y
100%  complete.
Info: Copied file flash:/config.cfg to flash:/temp/config.cfg...Done.

# Copy the file backup.zip to backup1.zip in the test directory from the current working directory flash:/test/.

<HUAWEI> pwd
flash:/test
<HUAWEI> copy backup.zip backup1.zip
Copy flash:/test/backup.zip to flash:/test/backup1.zip?[Y/N]:y
100%  complete.
Info: Copied file flash:/test/backup.zip to flash:/test/backup1.zip...Done. 
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >