Working with Hooks
The Post-clone Hook
Once a machine has been cloned, the post-clone hook gives you the ability to execute any custom code you require.
- Place a script called post-clone.sh inside the relevant template folder (/var/lib/kvm/yourtemplate or /var/lib/lxc/yourtemplate).
- The current working directory points to the cloned machine's location.
Important security note: Because the script runs with root privileges, a flawed script could modify any file on the entire filesystem.