Create New Hook
You can add a hook to run your script before/after an action.
To create new hook navigate to: "Hooks" and Click on "Create New Hook".
Example configuration page for hooks:
Example script that writes into logfile the time that the action was created:
<?php
$myfile = fopen("/hooks/hooks.log", "a") or die("Unable to open file!");
fwrite($myfile, date("d/m/Y H:i").": Job is running\n");
fclose($myfile);
?>
#!/bin/bash
FILENAME=/hooks/hook.log
echo $(date): Job is running >> $FILENAME
Hook Name
This will be used internally your convenience.
Hook Position
Choose to run your script Pre/Post your action.
Hook Type
The hook type defines on which action the hook should be executed.
Each hook type receives a different set of parameters by stdin.
Your script can read this data and use it to its own needs.
Those are the available action type and the parameters returns for each:
Hook Script
The hook script must be an executable file specified by full path.
For example:
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.