Fieldpine Logo Documentation Home   DESIGN NOTES

This information is a technical design note. Use extreme caution if relying on this information, it may be outdated or incomplete

Design Notes. Auto Maintainance


Auto Maintainance is involved in preventative maintainance and general housekeeping. It is designed to automate some of the housekeeping operations that need to be performed periodically

Operation

The design of the maintainance needs to remember:

  1. Very low volume retailers probably do not need this at all
  2. Computers are not always left on for background work overnight and we cannot just take over during the day
  3. Some of these tasks will be very infrequent, we need to be careful not to cause a support call when it is normal operation
  4. Variations in site poilicy/requirements
  5. In general, give users the chance to take action themselves, but set boundaries for those that continue to ignore warnings.
  6. Some tasks require exclusive access to database/files so cannot easily be done in the background.

AutoMaint is enabled by having the table AutoMaint in the database and the setting SettleAutoMaint defined. If SettleAutoMaint is 0/undefined it will currently disable the system, but a future release will have zero mean default mode.

Setting SettleAutoMaint definition

When a settlement close operation is performed and automaint is pending, the system will

  1. Display a screen saying AutoMaint is about to start
  2. Give user 60 seconds to stop this from happening
  3. Start scheduled tasks
  4. If enabled, power PC off when complete
After a settle close operation, this is the only time we can guarantee the POS is idle. Users that press close in middle of the day will soon learn to cancel rather than close, or not use EOD for sales checking.

Automaint will perform any tasks in the MaintList table regardless of how the commands got there. In addition, the POS has automated triggers to insert the tasks when thresholds are reached.

The list of pending Maintaince is available on fdlmgmt and also via maint(list(display))

Temp Files

With AutoMaint enabled, the check counts to see if over 9,000 files are present. The user continues to receive a warning with 2,000 files. When the 9,000 file threshold is reached, AutoMaint is scheduled (mcode=103).

The task simply deletes all .TMP files over 7 days old. This should address most sites, and if not then cleanup is best performed externally by Disk cleanup. Disk cleanup can be automatically called but has setup requirements that make it hard to automate.

Self Test

If mcode=108, the task deletes the file MaintCodeSelfTest.tmp if it exists. Users of the self test function need to create this file themselves

Database Compression

(Mcode=100) When the database exceeds the size and is first detected, the user receives a nice warning saying Maintainance has been scheduled - basically just informing them. After the initial warning, the startup warning process is the same. ie sites that never settle/close will get stronger warnings.

When the task executes, it will simply perform the equivalent of storage(compress)

Database cleanup

There is no auto detection yet- still WIP

(mcode=102) When executing the task invokes maint(archive(*)) which cleans up internal tables that are safe to clean. It also purges customer specific tables. See the code for exact list and operation.

Trading data (eg Sales) has a more restrictive logic than performed archive directly via quickcode

MCode=101 Directory Cleanup

MCode=104 Backup

MCode=105 Sync/2

MCode=106 Version Check

MCode=107 Site Specific

MCode=109 QuickCode