Skip to content
Storage and Backups

Storage and Backups

gpsu keeps its data in SQLite or PostgreSQL. It backs up what admins set up every day.

Database

GPSU_STORE_DRIVER chooses SQLite or PostgreSQL:

GPSU_STORE_PATH=/var/lib/gpsu/gpsu.db
VariableFlagDefault
GPSU_STORE_PATH--store-path/var/lib/gpsu/gpsu.db

The file needs local block storage, such as a ReadWriteOnce volume.

Warning

Don’t put the database on a network file system such as NFS. SQLite’s write-ahead log doesn’t work there.

Each reading records:

  • every temperature sensor and fan sensor
  • the power draw
  • the fan speed the curve gave and the fan speed gpsu set
  • how long the reading took

Retention

Admins set how long history stays under History on Settings › Backups, or at /api/v1/settings/history.

SettingDefaultAccepts
Each reading14 days1, 3, 7, 14, 30, 60, or 90 days
5-minute summaries400 days90, 180, or 400 days, or 2 or 5 years
  • gpsu deletes older history within the hour.
  • Charts read the five-minute summaries for any range past each reading’s limit.
  • Learning reads no further back than each reading stays.

Backups

gpsu backs up everything admins have set up once a day. Admins set when and how many backups stay under Automatic backups on Settings › Backups, or at /api/v1/settings/backups.

SettingDefaultAccepts
Daily backupEnabledEnabled, Disabled
Time03:00Any time of day
Backups kept143, 7, 14, 30, 60, or 90
  • The time is in gpsu’s local time zone. The TZ environment variable sets it.
  • A new time applies at once. The next backup runs at the new time.
  • Older backups past the number kept are deleted after the next backup. Every kind of backup counts.
  • The newest backup from before an upgrade and the newest from before a restore always stay. Manual and uploaded backups never push them out.

GPSU_BACKUP_DIR sets where backups live. It defaults to /var/lib/gpsu/backups. Its flag is --backup-dir.

A backup includes:

  • users and their preferences
  • local accounts and their password hashes
  • second factors, with each authenticator app’s secret and each passkey’s credential encrypted, and only a hash of each recovery code
  • settings
  • themes admins added
  • dashboards
  • API tokens
  • curve revisions
  • servers and their encrypted passwords

A backup leaves out:

  • readings
  • sessions and logins
  • overrides
  • the audit log

gpsu also backs up before every restore and before every upgrade that changes the database.

Important

If gpsu can’t write the backup before an upgrade, it doesn’t start. If it can’t write the backup before a restore, it doesn’t restore. The database stays as it was.

Restore

Admins restore from Settings › Backups.

Pick a backup

Choose a listed backup or upload a file.

Review the changes

gpsu shows what would change. Choose what to restore.

Confirm

gpsu backs up the current state first. It then restores what you chose.

When you restoreWhat happens
A backup without curves or serversThe current curves or servers stay as they are.
ServersEvery server is replaced with the backup’s. The Servers choice starts cleared when gpsu already has servers.
A server whose settings or password differFan control restarts for that server. Its fans run in iDRAC auto for a moment. Other servers keep running.
Encrypted passwordsThey stay encrypted with their original key. gpsu can read them only while that key is the seal key or a previous key.

Tip

If the key that encrypted a server’s password is gone, enter the password again. Use gpsu server edit r730xd --password or Settings › Servers.