Skip to content

Commit

Permalink
update README
Browse files Browse the repository at this point in the history
  • Loading branch information
xin053 committed Jun 11, 2020
1 parent 0302d0a commit 10e38f2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ pip3 install -r requirements.txt
支持的 `type``h3c, huawei, ruijie, cisco`

```yaml
# 备份文件保存路径
backup_path: '/home/xin053/swConfigBackup'
# 备份文件保存时长, 单位: 天
keep_time: 30
hosts:
- name: xxxH3C6800
Expand Down
2 changes: 2 additions & 0 deletions hosts.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# 备份文件保存路径
backup_path: '/home/xin053/swConfigBackup'
# 备份文件保存时长, 单位: 天
keep_time: 30
hosts:
- name: xxxH3C6800
Expand Down
2 changes: 1 addition & 1 deletion switchbackup.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ def backup(host):
future.result()

nowtime = datetime.datetime.now()

# 删除过期的配置文件
backup_filelist = list(os.listdir(config['backup_path']))
for backup_file in backup_filelist:
filetime = datetime.datetime.fromtimestamp(
Expand Down

0 comments on commit 10e38f2

Please sign in to comment.