如何上传/下载文件?❝ 用户可以通过串口(console口)、FTP、TFTP、SFTP、SCP、FTPS方式,在设备与设备之间或设备与主机之间传送文件。设备、主机在文件传输的过程中,均可以充当服务器或者客户端的角色。
各种文件传输方式的优缺点通过FTP进行文件上传/下载举例1、配置设备的FTP功能及FTP用户信息<HUAWEI> system-view
[HUAWEI] sysname FTP_
Server
[FTP_ Server ]ftp server enable
[FTP_ Server] aaa
[FTP_ Server-aaa] local-user admin1234 password irreversible-cipher hello@123
[FTP_ Serverr-aaa] local-user admin1234 privilege level 15
[FTP_ Server-aaa] local-user admin1234 service-type ftp
[FTP_ Server-aaa] local-user admin1234 ftp-directory flash:/
[FTP_ Server-aaa] quit
[FTP_ Server] quit
2、从终端PC通过FTP连接设备,输入用户名admin1234和密码hello@123. 并采用binary模式进行文件传输,终端以Window操作系统为例说明。C:\Documents and Settings\Administrator> ftp 10.136.23.5
连接到 10.136.23.5.
220 FTP service ready.
用户 (10.136.23.5: (none)): admin1234
331 Password required for admin1234.
密码
230 User logged in.
ftp> binary
200 Type set to I.
ftp>
3、将系统软件上传至设备以及配置文件备份至终端。#上传系统软件至设备
ftp> put devicesoft. cc
200 Port command okay.
150 Opening BINARY mode data connection for devicesoft.cc
226 Transfer comolete
ftp:发送23876556 字节,用时 25.35Seconds 560.79Kbytes/sec.
#备份配置文件
ftp> get vrpcfg. zip
200 Port command okay.
150 Opening BINARY mode data connection for vrpcfg.zip.
226 Transfer complete
ftp:收到 1257 字节,用时 0.03Seconds 40.55Kbytes/sec.
4、检查配置结果#在设备中执行dir命今,查看系统软件配置文件是否上传至设备
<FTP_Servers> dir
Directory of flash:/
Idx Attr Size(Bvte) Date Time FileName
……
6 -rw- 23,876.556 June 19 2022 14:24:24 devicesoft.cc
……
65,233 KR total (7,289 KB free)
如何删除文件?执行delete [/unreserved ] [/quiet] { filename | devicename } [all] 命令可以删除存储器中的指定文件,包括系统文件、 配置文件、 paf. license、日志文件等。 ❝ TIPs:不能在命令行界面删除设备当前正在使用的版本文件(包括系统软件、补 干扰件wab网页文件和配置文件等)。
文件删除举例删除存储器中的文件<HUAWEI> delete test txt
Delete flash:/test.txt?[Y/N]:y
Info: Deleting file flash:/test.txt...succeeded.
八使用delete命令删除的文任保留在
删除回收站中的文件<HUAWEI>reset recvcle-bin test.txt
Saueeze flash:/ test.txt?[Y/N]:y
%Cleared file test.txt
//使用reset recvcle-bin [filename ]命今,可彻底删除回收站中的
文件//
彻底删除存储器中的文件<HUAWEI>delete /unreserved test txt
Warnina: The contents of file flash:/ test.txt cannot
be recvcled. Continue? [Y/N]:Y
Info: Deleting file flash:/ test.txt……succeeded.
|