Hooks

With the JetBackup Hooks System, you can trigger custom scripts when JetBackup executes an task on specific hook points. For example, you could use hooks to notify you through your preferred application when a backup job starts, completes or fails.

Create New Hook

To create a new hook, click on "+ Create New Hook".

hooks


Example configuration page for hooks:

hooks create


Here's a sample script that goes through each parameter passed from the hook and prints the key(parameter name) and value of each parameter to a "testFile".

Hook Name

This will be used internally your convenience.

Hook Position

Choose to run your script Pre/Post selected task.

Hook Type

The hook type defines which task the hook should be executed.

Each hook type receives a different set of arguments.
Your script can fetch this data and use it to its own needs.

These are the available action type and the arguments that are passed:

Backup Hook



Backup Account Hook



Clone Hook



Clone Account Hook



Restore Hook



Download Hook



Reindex Hook


Hook Script

The hook script must be an executable file specified by full path.
For example:
/hooks/pre-backup.sh
If it's not an executable script, such as regular PHP file you should specify the executable to run your script.
For example:
/usr/bin/php /hooks/pre-backup.php
This executable should exit with success (0) if it executed successfully,
Otherwise, if it fails, it should exit with an error code - other than 0.

Hook Settings

hooks settings

Enable/Disable Hook

Click on Disable/Enable Hook to Disable/Enable your Hook.

Manage Hook

Click on Manage Hook to modify Hook settings.

Delete Hook

Click on Delete Hook to Delete your Hook permanently.