Feature Spotlight: Custom Hooks
In this feature spotlight we will take a closer look at the custom hooks feature inside of JetBackup. This feature gives server admins the ability to add their own custom scripts either pre (before) or post (after) every major JetBackup command function. Hooks can be used to run status checks, augment JetBackup command functions or abort them altogether if the requirements of the hook are not met.
It is not uncommon for server admins to backup their cPanel accounts to mountable folders using NFS, EXT, iSCSI, or XFS mounted disks (as long as it is an external hard drive). Upon completing a backup job, in order to increase the security of the data, server admins will unmount the drive while it is not in use.
To our knowledge, there is no out-of-the-box solution that allows you to mount and unmount traditional cPanel backups. However, utilizing Jetbackup’s custom hooks feature you now have the power to do it!
The following is a real life example of how a JetBackup user setup custom hooks to achieve this mount/unmount functionality within their backup system. Please note that this is not officially supported by JetBackup. Also, we do not know your specific server configuration, so please proceed with caution at your own risk.
First, we will presume your mountable drive for backups uses the /backup folder. Also, it is important to note that this implementation will only work on JetBackup versions 3.3 and up.
The above image shows the mounted /backup folder on the server.
In the image above, you will see a total of 14 hook points that will execute a mount / unmount command for any related JetBackup action that requires access to this backup folder: Backup, Clone, Snapshots, Restore, Downloads, Cron Jobs, and Reindex. While you can use a simple mount / unmount command like “unmount /backup”, this JetBackup user decided to use external bash scripts for more validation to have the ability to take action in the case an error arose.
Here is an example of the pre hook mount script ‘/ofir/scripts/mount.sh’:
Here is an example of the post hook mount script ‘/ofir/scripts/unmount.sh’
We hope you enjoyed this feature spotlight of custom hooks. If you are a Jetbackup user and have taken advantage of the custom hooks feature, please feel free to share your implementation with the rest of the JetApps community at: https://forum.jetapps.com .
Start your FREE trial
of Jetbackup Today!
Get Started Now!
No credit card required.
Install Jetbackup in minutes.
Latest Posts
Categories
Archive
- October 2024
- September 2024
- August 2024
- July 2024
- May 2024
- April 2024
- February 2024
- January 2024
- December 2023
- November 2023
- October 2023
- August 2023
- July 2023
- April 2023
- January 2023
- August 2022
- May 2022
- March 2022
- January 2022
- December 2021
- November 2021
- October 2021
- September 2021
- August 2021
- July 2021
- June 2021
- May 2021
- March 2021
- February 2021
- January 2021
- December 2020
- October 2020
- August 2020
- April 2020
- March 2020
- February 2020
- January 2020
- December 2019
- November 2019
- September 2019
- August 2019
- July 2019
- June 2019
- April 2019
- March 2019
- January 2019
- December 2018
- November 2018
- October 2018
- September 2018
- August 2018
- May 2018
- April 2018
- March 2018
- February 2018
- January 2018
- December 2017
- November 2017