Delete old trace-files, using a scheduled task (kb2986)
The information in this article applies to:
- SwyxWare all versions
This article provides a script to delete SwyxWare trace files from your System using a scheduled task. The script reads the trace folder from the registry and deletes all traces older then 3 days.
It is possible to define a different tracefolder as it is possible to change the age of the traces.
Download the script using the link at the end of this article.
copy the script DeleteOldTraces.wsf to your local harddisk (e. g. C:\Program files\Scripts\ DeleteOldTraces.wsf)
Planning of execution interval and age of files to delete
The default values of the script are its path (taken from registry entry of IpPbxSrv) and the age of files (3 days), which will be deleted. These values can be changed via commandline parameters. Therefore set the values like in the following example:
cscript "C:\Program files\Scripts\ DeleteOldTraces.wsf" /path:"D:\Traces" \age:"1"
Create a scheduled task using the commandline:
schtasks /create /tn DeleteOldTraces /sc DAILY /st 22:00:00 /ru QA\swyxpbx /rp password /tr "c:\WINDOWS\system32\cscript.exe \"c:\Program Files\SwyxWare\ DeleteOldTraces.wsf\" //B"
/create - create new Job
/tn - name of new job
/sc - schedule frequency
/st - starttime
/ru - run as user (e. g. your pbx-user in your domain)
/rp - user password (e. g. relating password)
/tr - command string to execute (e. g. cscript-path + script itself + needed options)
Create a scheduled task using the GUI:
Klick "Start --> Control Panel --> Scheduled Tasks --> Add Scheduled Task"
when prompted about a program to start enter C:\WINDOWS\system32\cscript.exe \"<yourPath>\" //B, where <yourPath> is the absolute path to the DeleteOldTraces.wsf - script on your local harddisk
Enter appropriate values for time of execution.
Enter user-account of IpPbxSrv-service and relating password.
Watch eventlog for info-messages and warnings
The third-party contact information included in this article is provided to help you find the technical support you need. This contact information is subject to change without notice. Swyx in no way guarantees the accuracy of this third-party contact information nor is responsible for it's content.