This option can be specified in conjunction with --update or --query to set an expiration time on the record. The option has two formats. You can either specify an absolute time, as the number of seconds since Jan 1, 1970 GMT, or you can specify an offset from the current time with the format:
Where + means in the future, - means in the past, count is a number, and units is one of the following characters:
s - seconds
-
m - minutes
-
h - hours
-
- D - days
-
- W - weeks
-
- M - months
-
- Y - years
-
For example --expire=+36D means the record will be deleted in 36 days. If you always look up key with the command:
dbutil --query --expire=+36D key
then the key will only expire if you do not look it up within 36 days.
Note that dbutil keeps a sorted list of the records by time of last access. Thus, purging old records is not an inherently expensive operation, and happens automatically whenever you modify the database.