VBScript For Backupper Image File Management
We wanted to implement a Backupper image file management protocol whereby we made a daily backup image file and saved and maintaned at all times at least 4 days of backup image files in our backup image folder. In order to accomplish this, we disabled the Backupper Disk Space Management option under the Backup Scheme tab and tried a simple batch file which we ran through Task Scheduler. The batch file was based on the forfiles command and generally worked well. Unfortunately, it had some problems.
Using the forfiles command in a batch file deleted backup image files regardless of whether there were new files to take the place of the older files. So, if there were to be an issue with our backups and no backup image files were created for say an entire week, we would end up with a completely empty backup image folder because all of the backup image files would have been older than 4 days and would have been deleted.
The attached VBScript (saved in .pdf for attachment purposes) addresses this problem by making sure that there are always 4 backup image files retained in the backup image folder, even if some of the backup image files are actually older than 4 days. The VBScript is safer than the forefiles batch file. We run the VBScript from Task Scheduler using a batch file to avoid popups (see below).
The VBScript also creates a running log file, which we store in a directory called Log. The running log tells us the dates of the backup image files in the storage folder, how many backup image files have been deleted, and other useful information. The Customization Section of the VBScript file can be changed to set the number of days for retained backup image files, the backup file folder, and the log file directory.
We run the VBScript file from the attached batch file using the cscript command (triggered on a daily schedule through Task Scheduler):
We hope that this is useful to someone.