pre-backup hook for specific accounts

Simone Fantini shared this idea 2 years ago
Supported through Custom Hook

ability to create a pre-backup hook only for specific account and not for all accounts (eg run a custom script only for user XX)

Replies (2)

photo
1

Hello Simone,


Thank you for opening up you're feature request with us! Just to clarify, you should be able to achieve this with our "Pre Backup Account Hook" which passes the following arguments:

Argument IndexValue
$1 Backup Job ID
$2 Account ID
$3 Account User Name
$4 Backup Account Log ID

So for your custom script, you should be able to add logic that checks for either the Account ID or Account Username that gets passed from our hook and execute your script accordingly.


For more information regarding Hook Positions and Arguments that get passed, please CLICK HERE.


Thank You,

JetApps Team.

photo
2

Hello, the fact is that i have opened a ticket about this exact request, and someone from Support told me that it was not possibile to do it , so they suggested me to open a request here :)


anyway, glad to know that i can but documentation is a little bit odd. can you please help me to create a simple script example?


here are the variables:

username: USER01

script to run: /home/user01/scripts/scripttorun.sh


i would like that only for this user to run the script (/home/user01/scripts/scripttorun.sh) before the jetbackup starts backing up files on cpanel


thank you

simone

photo
1

Hello Simone,


Thank you for following up. In this case, for example, you would need to add a similar logic to your scripttorun.sh:


argArray=( "$@" ) # Storing args passed by the JetBackup Hook in new array

if [ ${argArray[2]} = 'USER01' ]
then
        ## EXECUTE THE ACTION(S) NEEDED
fi

Thank You,

JetApps Team.

photo
2

excelent. i will implement it right away and let you know

photo
Leave a Comment
 
Attach a file