auto create backup before deleting virtual system

on Cloudmin Configuration > Post-modification scripts there is an option of Command to run before deleting a system i want to use this to create backup before deleting a virtual system, i'm thinking of calling the command line API but how do i supply the --host flags with current virtual system host name?

Status: 
Closed (fixed)

Comments

You can use $SERVERMANAGER_HOST to get the hostname. The full pre-change script should be like :

if [ "$SERVERMANAGER_ACTION" = "DELETE" ]; then
  cloudmin backup-systems --host $SERVERMANAGER_HOST --dest /backup
fi

other than $SERVERMANAGER_ACTION and $SERVERMANAGER_HOST what variables available for scripting? i can't find it in documentation.

Basically everything in the file /etc/webmin/servers/XXX.serv , where XXX is the unique ID for the VM.

Automatically closed -- issue fixed for 2 weeks with no activity.