---
name: "dspam_maintenance"
section: "1"
platform: "linux"
package: "dspam"
version: "3.10.1+dfsg-11"
release: "Debian 7 (Wheezy)"
platforms: ["linux"]
url: "https://new.carta.tech/dspam_maintenance"
---

# dspam\_maintenance(1)

remove old signatures and unimportant tokens from the DSPAM storage backend

## NAME

**dspam\_maintenance**  - remove old signatures and unimportant tokens from the DSPAM storage backend

## SYNOPSIS

**dspam\_maintenance** \[**--profile** =PROFILE\] \[**--logdays** =no\_of\_days\] \[**--signatures** =no\_of\_days\] \[**--neutral** =no\_of\_days\] \[**--unused** =no\_of\_days\] \[**--hapaxes** =no\_of\_days\] \[**--hits1s** =no\_of\_days\] \[**--hits1i** =no\_of\_days\] \[**--without-sql-purge** \] \[**--with-sql-automatization** \] \[**--with-sql-autoupdate** \] \[**--purgescriptdir=directory** \] \[**--with-all-drivers** \] \[**--verbose** \]

## DESCRIPTION

**dspam\_maintenance** is used to remove old signatures/tokens and unimportant tokens from the DSPAM storage backend and purge old log entries in user and system logs.

This script can be called from the command line or run from within cron. Either add a line in your crontab or add this script in your cron.{hourly,daily,weekly,monthly}. Running this script every hour might not be the best idea but it's your decision if you want to do so.

## OPTIONS

- **--profile=***PROFILE*

  -

  Specify a storage profile from dspam.conf. The storage profile selected will be used for all database connectivity.

-

  **NOTE:**  See **dspam.conf**  for more information.

- **--logdays=***no\_of\_days*

  -

  All log entries older than **no\_of\_days**  days will be removed.

-

  **NOTE:**  Default is **31**  days. (for more info: **man dspam\_logrotate** )

- **--signatures=***no\_of\_days*

  -

  All signatures older than **no\_of\_days** days will be removed.

-

  **NOTE:**  Default value is set by the **PurgeSignatures**  option in dspam.conf, if this option is not set, the default value is **14**  days. This option is only used for the Hash driver.

- **--neutral=***no\_of\_days*

  -

  Deletes all tokens from the target users database whose probability is between 0.35 and 0.65 (fairly neutral, useless data).

-

  **NOTE:**  Default value is set by the **PurgeNeutral**  option in dspam.conf, if this option is not set, the default value is **90**  days.

- **--unused=***no\_of\_days*

  -

  Remove stale tokens which have not been used for a long period of time.

-

  **NOTE:**  Default value is set by the **PurgeUnused**  option in dspam.conf, if this option is not set, the default value is **90**  days.

- **--hapaxes=***no\_of\_days*

  -

  Remove tokens with a total hit count below 5 (which will be assigned a hapaxial value by DSPAM).

-

  **NOTE:**  Default value is set by the **PurgeHapaxes**  option in dspam.conf, if this option is not set, the default value is **30**  days.

- **--hits1s=***no\_of\_days*

  -

  Remove tokens with a single SPAM hit.

-

  **NOTE:**  Default value is set by the **PurgeHits1S**  option in dspam.conf, if this option is not set, the default value is **15**  days.

- **--hits1i=***no\_of\_days*

  -

  Remove tokens with a single INNOCENT hit.

-

  **NOTE:**  Default value is set by the **PurgeHits1I**  option in dspam.conf, if this option is not set, the default value is **15**  days.

- **--without-sql-purge**

  -

  Do not use SQL based purging. Only run dspam\_clean.

-

  **NOTE:**  Default is **off**  (aka: use SQL based purging).

- **--with-sql-optimization**

  -

  Run VACUUM (for PostgreSQL/SQLite) and/or OPTIMIZE (for MySQL).

-

  **NOTE:**  Default is **off**  (aka: do not use optimizations).

- **--with-sql-autoupdate**

  -

  Run SQL based purging with purge day values passed to dspam\_maintenance.

-

  **NOTE:**  Default is **off**  (aka: do not attempt to modify SQL instructions).

- **--purgescriptdir=***directory*

  -

  Space separated list of directories where to search for SQL files used for the SQL based purging.

- **--with-all-drivers**

  -

  Process all installed storage drivers (not just the active driver).

-

  **NOTE:**  Default is **true**  (aka: process all installed drivers).

- **--verbose**

  -

  Verbose output while running maintenance script.

## EXIT VALUE

- **0**

  Operation was successful.

- **other**

  Operation resulted in an error. Run the script with **--verbose**  to get more information about error.

## COPYRIGHT

Copyright © 2002-2010 DSPAM Project\
 All rights reserved.\

For more information, see http://dspam.sourceforge.net.

## SEE ALSO

[**dspam**(1)](/dspam/1.md), [**dspam\_admin**(1)](/dspam_admin/1.md), [**dspam\_clean**(1)](/dspam_clean/1.md), [**dspam\_crc**(1)](/dspam_crc/1.md), [**dspam\_dump**(1)](/dspam_dump/1.md), [**dspam\_logrotate**(1)](/dspam_logrotate/1.md), [**dspam\_merge**(1)](/dspam_merge/1.md), [**dspam\_stats**(1)](/dspam_stats/1.md), [**dspam\_train**(1)](/dspam_train/1.md)
