Deleting Unnecessary Files from the iMedConsent Server

From iMedConsent_Docs
Jump to: navigation, search

Trace logs, images and completed document files are retained on the server until manually purged by an IT administrator. These files should be removed on a regular basis to free-up system storage space.

This process can easily be automated using a simple batch file and Windows Scheduled Tasks.

A batch file has been created for this purpose and is now distributed with each iMedConsent release. The file is named delfiles.bat and is stored at “C:\documentService\Maintenance” on the iMedConsent server.

The file reads:

@echo off
echo.
echo Removing old documentService log files
forfiles /p C:\documentService\bin /s /m trace*.* /d -120 /c "cmd /c del @path"
echo.
echo Removing old emrRun log files
forfiles /p C:\documentService\emrRun\bin /s /m trace*.* /d -120 /c "cmd /c del @path"
echo.
echo Removing old image files
forfiles /p D:\DocumentStore\imagingShare /s /m *.tif* /d -120 /c "cmd /c del @path"
echo.
echo Removing old completed jobs
forfiles /p D:\DocumentStore\storeToPurge /s /m iMedDoc*.* /d -120 /c "cmd /c del @path"

The default for deletion in this batch file is files over 120 days old, “/d -120”. This value may be edited. For example, “/d -60” for files over 60 days old or “/d -180” for files over 180 days old.

Using Windows Task Scheduler to Automatically Run delfiles.bat

Windows Task Scheduler is used to configure the batch file to run on a specific schedule or cycle.

  1. On the iMedConsent server, navigate to Start -> Control Panel -> Scheduled Tasks.
  2. Click on "Add Scheduled Task." The following will be displayed:

    Del unnec html 148ebf1f.png


  3. Click “Next” to begin the Scheduled Task Wizard.

    Del unnec html m749d922c.png


  4. Click the “Browse” button and navigate to the delfiles.bat file at “C:\documentService\Maintenance”.

    Del unnec html m29d1dd9b.png


  5. Select the file and click the “Open” button.

    Del unnec html m2f3e01b.png


  6. Select the frequency for the file to run at, then click “Next”.

    Del unnec html m22da949a.png


  7. Select other frequency rules on this screen (which are dependent on what was entered on the previous screen).

    Del unnec html 1ea2ef0c.png


  8. Enter user name and password to establish the user authentication for running the file. If the user is part of a password change policy, be sure to update the password or the batch file will not run. An entry in the Event Viewer will be created if authentication fails.

    Del unnec html m784d8008.png


  9. Click the “Finish” button to complete the process.