Perform GoCD server backups on a schedule

To run a GoCD server backup at a given time, use a timer. Timers understand a cron-like specification for when to perform a backup. The GoCD server can be optionally configured to invoke a post-backup script to allow you to copy the backup to an external machine or service (like AWS’ S3).

The post backup script

The post backup script, if configured, will be invoked regardless of success or failure of the script, and will receive the following environment variables:

NameDescription
GOCD_BACKUP_STATUSThe status of the backup. Can be failure or success.
GOCD_BACKUP_INITIATED_VIAIf the backup was initiated via a timer, this will contain the value timer.
GOCD_BACKUP_INITIATED_BY_USERIf the backup was initiated by a user, the login name of the user that triggered the backup.
GOCD_BACKUP_TIMESTAMPThe ISO8601 formatted timestamp when the backup was attempted. E.g. 2018-08-29T14:00:35Z.
GOCD_BACKUP_BASE_DIRIf the status was success, this variable will contain the backup base directory. E.g. /var/lib/go-server/artifacts/serverBackups.
GOCD_BACKUP_PATHIf the status was success, this variable will contain the directory where the current backup snapshot was stored. E.g. /var/lib/go-server/artifacts/serverBackups/backup_20180829-140035.

For more information see < backup >