0

i'm making a shell script to synchronize two instance of grafana but i always got the error {"message":"folder title cannot be empty"}./dir_import.sh: line 25: -d: command not found

but the title is not empty and i dont know wht ?

here is the code i try

for dir in ${TEMP_DIR}/folder.*.json; do
        name=$(jq -r .title "${dir}")
        echo "Uploading ${name} to Grafana"
        dir_json=$(jq '.| {uid: .uid, title: .title}' ${dir})
        curl -sSH "Authorization: Bearer $DEST_GRAFANA_API_KEY" \
                -H "Content-Type: application/json" \
                -X POST "${DEST_GRAFANA_ENDPOINT}/api/folders/" \
                -d @"${dir_json}"
    echo
done

0 Answers0