Skip to main content
Hooks run a shell command at two points while Station stores an upload. Use them to trigger an offsite sync, write to a log, or ping a monitoring service.
  • Pre command: after the upload passes its checksum, before Station stores it. Station waits for it to finish.
  • Post command: after storing, with THREETOONEGO_STATUS set to ok or error. Retrying an upload that already finished doesn’t rerun hooks.

Set up

Follow the shared custom-script setup for uploading files, configuring independent PRE and POST commands, execution limits, and secret handling.

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. Every hook gets these variables: The post command also gets:

Example: write a snapshot receipt

after-upload.sh
Set POST command to after-upload.sh. This script manages its own log; keep it private and arrange rotation on the host.
The Station image is a minimal Alpine image with sh and curl. Tools like rclone aren’t included. Run those on the host or in another container that reads the same backup folder.

Notifications and secrets

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