Skip to main content
Hooks run a shell command around each job in a backup cycle.
  • Pre command: before Scout scans the job. Scout waits for it, so it can prepare files in the folder first.
  • Post command: after the job finishes, whether it uploaded, was unchanged, or failed. Cancelling skips it.
Hooks run in scheduled cycles and Run Backup Cycle Now, but not for Force Upload.

Set up

Follow the shared custom-script setup for uploading files, configuring independent PRE and POST commands, execution limits, and secret handling. The same commands run for every job. Use THREETOONEGO_JOB_NAME to act on specific jobs. Scout prepares jobs concurrently, so their scripts can overlap; keep per-job output separate. Cancel operation stops the active Scout commands, and cancellation skips POST.

Environment variables

Use shell variables such as $THREETOONEGO_JOB_NAME in commands and scripts. The {{ job_name }} syntax applies to HTTP message and JSON templates, and is not expanded in shell scripts. In the pre command these describe the job’s state from its previous run. In the post command they describe the run that just finished.

Example: report each job to a health check

after-job.sh
Common THREETOONEGO_LAST_STATUS values after a job: Set POST command to after-job.sh.
The Scout image is a minimal Alpine image with sh and curl. Other tools, such as database clients, aren’t included. To dump a database before a backup, run the dump on the host on a schedule ahead of Scout’s cycle.

Notifications and secrets

Use HTTP notifications for remote messages. For script credentials and execution permissions, see Custom scripts and Integration secrets.