backup_location="/mnt/backup/docker_containers"
container_list=$(docker inspect --format '{{.Name}}' $(docker container list -q --all))


for container in $container_list
do
    echo "${container}" | grep -v "transmission" &>/dev/null
    if [ $? -eq 0 ]
    then
        output_path="${backup_location}${container}.tar"
        echo "Exporting $container to $output_path"
        docker container export $container -o $output_path
    fi
done