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

1

Open Custom Scripts

In Scout, click Custom Scripts.
2

Upload a script (optional)

Under Uploaded Items, upload up to 3 files. Only .sh scripts and .txt helper files are allowed, and they must be UTF-8 text. .sh files are made executable, and Windows line endings are converted.
3

Set the commands

Enter a Pre Command and/or Post Command. Either:
  • the name of an uploaded script, such as before-backup.sh, or
  • any shell command, such as curl -fsS https://hc-ping.com/your-id.
Commands run with sh -c inside the Scout container, from the hook scripts folder (/hook-scripts). Each command has a 5-minute timeout and stops if you click Cancel operation. Output and non-zero exit codes go to Scout’s logs. A failing hook doesn’t stop the backup. The same commands run for every job. Use THREETOONEGO_JOB_NAME to act on specific jobs. Scout prepares different jobs concurrently, so their hooks can overlap. Keep per-job output separate when your scripts write files.

Environment variables

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.