将配置备份到存档站点
您可以配置设备以定期将其配置传输到存档文件。
配置活动配置的传输
如果要将设备的当前配置备份到存档站点,可以将设备配置为定期或在每次提交后通过 FTP、HTTP 或安全复制 (SCP) 传输其活动配置。
要配置设备将其活动配置传输到存档站点,请在层次结构级别添加语句 [edit system archival configuration]
:
[edit system archival configuration] archive-sites { ftp://username@host<:port>/url-path; http://username@host<:port>/url-path; scp://username@host<:port>/url-path; } routing-instance routing-instance; transfer-interval interval; transfer-on-commit;
要配置设备以定期将其活动配置传输到存档站点,请在 transfer-interval
层次结构级别添加语句 [edit system archival configuration]
:
[edit system archival configuration] transfer-interval interval;
时间 interval
从 15 分钟到 2880 分钟不等。
要配置设备,在每次提交配置时将配置传输到存档站点,请在层次结构级别添加 transfer-on-commit
语句 [edit system archival configuration]
:
[edit system archival configuration] transfer-on-commit;
配置设备以传输其配置文件时,请指定文件传输到的存档站点。如果指定多个存档站点,设备将尝试将文件传输到列表中的第一个存档站点,仅在传输失败时移动到下一个站点。
使用该 archive-sites
语句时,您可以将目标指定为 FTP URL、HTTP URL 或 SCP 样式的远程文件规范。还支持 URL 类型 file:// 。指定存档站点时,请勿在 URL 的末尾添加正斜杠 (/)。
要配置存档站点,请在 archive-sites
层次结构级别添加语句 [edit system archival configuration]
:
[edit system archival configuration] archive-sites { file://<path>/<filename>; ftp://username@host<:port>/url-path password password; http://username@host<:port>/url-path password password; scp://username@host<:port>/url-path password password; }
在使用 IPv6 主机地址的语句中指定 URL 时,必须将整个 URL 括在引号 (“”) 中,并将 IPv6 主机地址括在括号 ([ ]) 中。例如 ,“ftp://username<:password>@[ipv6-host-address]<:port>/url-path”
如果网络设备通过特定的路由实例到达存档服务器,请在 routing-instance
层次结构级别配置语句 [edit system archival configuration]
,并指定路由实例。
[edit system archival configuration] routing-instance routing-instance;
目标文件名以以下格式保存,其中 n 与已存档的压缩配置回滚文件的编号相对应:
<router-name>_YYYYMMDD_HHMMSS_juniper.conf.n.gz
目标文件名中包含的时间以协调世界时 (UTC) 为单位。