def clean_dir_hook(spawner):
    """Delete directory"""
    username = spawner.user.name  # get the username
    temp_path = os.path.join('/volumes/jupyterhub', username, 'temp')
    if os.path.exists(temp_path) and os.path.isdir(temp_path):
        shutil.rmtree(temp_path)
Delete directory
examples/bootstrap-script/jupyterhub_config.py