Printed 2017/08/20 12:22AM

How to setup a task to delete the old backup files or log files from the server ?


Cleaning up the servers disks on daily basis is very important task for smooth functioning of servers.We have seen many times our report servers went down  and database backup failed due to the lack of disk space.
It is a tedious task to log in to the servers and delete the old files manually on regular basis. It will be more tedious if you need to manage more servers.The below VB script will help you to schedule the clean up job using a Windows Task Scheduler.


This VB script will help to remove files from the folders which is older than the retention days mentioned in the function call.Now this can be scheduled to run on specified schedule using windows task manager. The account in which this task is scheduled should have full security right on the folders to perform this task. The VB script file is downloadable at

Hope this will help you to save lot of time!

Copyright © 2002-2017 Redgate. All Rights Reserved. Privacy Policy. Terms of Use. Report Abuse.