4 Backing up: VM or Docker

4.1 The included script

deploy/backup.sh writes db-<stamp>.dump and uploads-<stamp>.tar.gz. Run it from the installation directory, nightly from cron, and copy the result off the host:

0 2 * * * cd /srv/grc && ./deploy/backup.sh /var/backups/grc 14 >> /var/log/grc-backup.log 2>&1

pg_dump gives a consistent copy while the application runs. The Administrator's Guide, under Backup and Restore, covers scheduling, encrypting with age and copying off the server. Leave out .partial-* when you copy: a run killed outright leaves one behind, unencrypted until age has run, and the next run removes it after a day. A backup on the same disk as the database does not survive losing that disk. Alert on a failed or missing run.

4.2 Other tools that fit