-DiskState-

Deletion Engine

What does it do?

DiskState includes a Deletion Engine to clean up specified folders ignoring user-definable files, files older than a given number of days and so forth. Works with all files in the directory tree and can also delete empty folders upon selection. The engine can also be told what to delete, in addition to what to ignore. The engine is available under Windows 7/Vista/XP.

The engine is typically used to clean up large shared temporary folders on servers. A system manager would typically want to delete files older than 7 days every night at 2 a.m independently of the file rights on the server. Of course, the system manager can schedule the engine to only work during the weekend.

It can also be used to remove a few files from an entire folder tree. One example: Using Emacs generates a lot of ~ backup files. These can be specified for removal (use Include rule ".*~$" without the quotes).

Note: By default, files and folders that are deleted by the deletion engine in DiskState are not placed under Zip Safety. Most of our users completely remove data off the folder using the "modified since" criteria. However, if you want to enable Zip Safety in your deletion engine, please check the "Use Zip Safety with archiving" in Settings | Deletion Engine | More Settings.

Can I use it for archiving?

The Deletion Engine can be used for archiving. There are a few notable tips here first. You might consider opening RegEdit at HKEY_LOCAL_MACHINE\SOFTWARE\Geekcorp\DiskState\DeleteEngine. If you like the engine to automatically rotate the log file and the Zip Safety files upon every run, set the registry DWORD value RotateLogAndZipAlways to 1 (default is 0, only rotating when necessary). Examples of rotations are C:\Program Files\DiskState\DelEngine.log -> C:\Program Files\DiskState\archived_2015-03-28-1515_DelEngine.log.

You can also run the Deletion Engine in simulation mode. This will give you an idea how your settings will play out. Set the DWORD SimulatedDelete to 1 to enable this (default is 0, which implies real file deletions).

Setting up

  1. Go to the settings and click on the "Deletion Engine" tab.
  2. Click the "Service Setup" to set up the Windows service for the Deletion Engine.
  3. Enter the user context to run the service under. Use DOMAIN\UserName or .\UserName for a local account. Since you would typically want to delete all the files in the specified folders (ignore file rights), use an Administrator account here.
  4. Enter the user password. Note: As a security measure, this password is not stored in the registry. It is generally not need unless the service is reinstalled.
  5. Click "Install Service".
  6. Observe the text to the left of the "Stop Service" button to see if the service gets installed correctly.
  7. If DiskState fails to install the service, please see the F.A.Q. on this.
  8. Tap the "Schedule" button to set the scheduling of the deletion engine. In this window, specify the time and weekday you want the service to be run (with repetitions if required).
  9. Once the scheduling is done, click "Start Service" to finalize the engine setup.

Configuring

  1. Go to the settings and click on the "Deletion Engine" tab.
  2. Make sure the engine is not enabled when configuring it (to avoid it accidently to schedule in while configuring the engine).
  3. Specify which folder should be cleaned. Examples: C:\Temp or C:\Users\UserName\Downloads
  4. If you want to keep certain files in the specified folders, E.g. Backup folders, add regular expression rules on this. These rules are added to the "Exclude folders and files" list box.
  5. If you want DiskState to only delete a given type of files, specify the regular expression rules on this. These rules are added to the "Only delete these files".
  6. Click "More settings" tab in the "Deletion Engine" tab (bottom).
  7. Specify rules to go by. For example: delete only files which haven't been modified in 7 days, delete empty folders and include subfolders in the folder hierarchy. Click "Customize" here if you want to set specify maximum age for given folders.
  8. If you want to backup files before deletion, check the "Use Zip Safety with archiving" checkbox. This might be useful if the Deletion Engine is to be used for historical file archiving. In reality, DiskState will add a date prefix to each file it is going to archive before deletion (year-month-day-hour-minute-second_filename).
  9. If you are interested in knowing what the Deletion Engine has been doing (if enabled, it is working totally in the background while you are not even logged on to your workstation), you can enable logging. The magnifier glass to the left of the log file name views the log if any.
  10. When you are satisfied with your settings, click back to the "Engine" tab.
  11. Find a suitable time of day to schedule this service. Note that this is military time. I.e. 02:00 is 2 a.m. and 23:00 is 11 p.m.
  12. Enable the Deletion Engine by checking the "Enabled" box.