Clearing Up Old Session Data

Running the command

Connect to your server and run:

docker exec -ti backend node dist/scripts/session-clear-up.js

Command help

$ docker exec -ti backend node dist/scripts/session-clear-up.js --help
Options:
  --help         Show help                                             [boolean]
  --version      Show version number                                   [boolean]
  --dry-run                                           [boolean] [default: false]
  --session-id   Filter sessions by id                                  [string]
  --user-id      Filter sessions by user id                             [string]
  --months       Find sessions older than <value> months   [number] [default: 6]
  --verbose, -v

Example output

info: Finding sessions older than 6 months (Wed Aug 14 2019 16:09:53 GMT+0000)
info: Found 2 sessions to delete

Are you sure you want to delete sessions? If you haven't taken a backup, please do so. Please type yes to confirm.

        Hint: Alternatively, use the --dry-run option to get an idea of what may be deleted

>