Solved Hooks problem

LawsHosting

Verified User
Joined
Sep 13, 2008
Messages
2,438
Location
London UK
Instead of relying on the message system, I decided to use a 3rd-party site to send me alerts of successful/failed reseller backups..... However, the following fails:

all_backup_post.sh (755 diradmin:diradmin)
Code:
if [ "$owner" == "blah" ] && [ "$success" -eq 1 ]; then
curl "url/success"
echo "[debug] lawshost1: success" >> /tmp/lawshost1.txt
elif [ "$owner" == "blah" ] && [ "$success" -eq 0 ]; then
curl "url/fail"
echo "[debug] lawshost1: fail" >> /tmp/lawshost1.txt
fi
However, nothing triggers....... I tried uppercase $OWNER & $SUCCESS too, still nothing.

Am I stupid or what?
 
Hello Peter,

1. create all_backup_post.sh with permissions (-rwxr-xr-x) with the following content:

Bash:
#!/bin/bash
env >> $0.out

2. start a backup task
3. as soon as it finishes check content of all_backup_post.sh.out

This way you will see:

1. whether or not the script is executed
2. what variables exist in the environment

Then you might remove/update the script to meet your needs considering all the collecting information.
 
Hold on, Hold on, Hold on, Hold on, Hold on, Hold on, Hold on, Hold on, Hold on........

I'm a donkey....... it's all_backups_post.sh, not all_backup_post.sh

Will monitor and will mark as solved tomorrow
 
Last edited:
Back
Top