I am using boto3 API to create an Amazon EMR cluster.
Using bootstrap actions, I am able to run script when the server is started. Can a similar action be done when I terminate the cluster, so that I am able to do actions like backup the metastore and data to S3 before the cluster is terminated?