Procedure
To create a script that deletes old backups of the startup and configuration files, copy the VBS script
below and save it to the following path:
D:\scripts\delete_old_backups.vbs
This script deletes every file in the
D:\Cisco\9xxx\config
directory that has
a
.config
file extension and is older than seven days.
Option Explicit
On Error Resume Next
Dim oFSO, oFolder, sDirectoryPath
Dim oFileCollection, oFile, sDir
Dim iDaysOld
' Specify Directory Path for File Deletion
sDirectoryPath = "D:\Cisco\9xxx\config"
' Specify Number of Days Old File to Delete
iDaysOld = 7
Set oFSO = CreateObject("Scripting.FileSystemObject")
Set oFolder = oFSO.GetFolder(sDirectoryPath)
Set oFileCollection = oFolder.Files
For each oFile in oFileCollection
Specify File Extension
'Specify number with Number of characters in the file extension
If LCase(Right(Cstr(oFile.Name), 6)) = "config" Then
If oFile.DateLastModified < (Date() - iDaysOld) Then
oFile.Delete(True)
End If
End If
Next
Set oFSO = Nothing
Set oFolder = Nothing
Set oFileCollection = Nothing
Set oFile = Nothing
Scheduling the task to purge older backup files
Schedule the script called
D:\scripts\delete_old_backups.vbs
daily to purge older backup files.
About this task
This script deletes every file in the
D:\Cisco\9xxx\config
directory with a
.config
file
extension older than seven days.
Before you begin
Obtain the password for the
[Domain]\svc-vmfms01
account from your VMware administrator.
Procedure
1
To run the
.vbs
script daily at 01:00, select
Start
>
Programs
>
Accessories
>
System Tools
>
Scheduled Tasks
2
Browse to
D:\scripts\delete_old_backups.vbs
.
3
Use the credentials for the
[Domain}\svc-vmfms01
account to run the task.
155
|
Backing up Cisco MDS switches
Содержание Vblock Systems 350
Страница 1: ...Dell EMC VxBlock and Vblock Systems 350 Administration Guide Document revision 1 8 October 2017 ...
Страница 114: ...Related information VMware vSphere Networking guide Managing VMware VDS 114 ...
Страница 122: ...Related information Cisco Nexus 1000V Troubleshooting Guide Managing the Cisco Nexus 1000V Series Switch 122 ...
Страница 156: ...4 On the Schedule tab schedule the task to run daily at 1 00 AM Backing up Cisco MDS switches 156 ...